#sup, can anyone explain to me how testing service macros work?

55 messages · Page 1 of 1 (latest)

digital sequoia
#

(btw, ping me if u answer please)

feral stone
#

@digital sequoia if you read the fourm, it states that it is a big block of code that can be run in this one line, "Macros are essentially substitutions for large blocks of code that shouldn't need to be rewritten each time you want to call them."

digital sequoia
vital ferryBOT
#

studio** You are now Level 4! **studio

feral stone
#

im going to do research for the next 5 or so minutes if that is ok

digital sequoia
#

sure, go ahead

feral stone
#

im looking though it and it looks like a big fat if function

#

also testservise is like a function

#

service*

#

@digital sequoia

#

something like this
local TestService = game:GetService("TestService")

TestService:Run(function() 

    local playerHealth = game.Players.LocalPlayer.Character.Humanoid.Health

    RBX_CHECK(playerHealth > 0) -- Checks if player health is greater than 0

end)
digital sequoia
#

Humm

#

okey, I will try that, ty!

feral stone
#

but

#

wait

#

that was an example

#

@digital sequoia that wont work as that is a server script while the humnoid is a local

digital sequoia
#

ik, ik, I just want to try to use the macros to see if they are enough for my use case

feral stone
#

@digital sequoia I GET IT NOW

vital ferryBOT
#

studio** You are now Level 3! **studio

feral stone
#

i just relized what it actually does

digital sequoia
feral stone
#

the test service, in my ex is so that if the test passes / condition is met, nothing happens while if it doesn't then it throws out an error

digital sequoia
#

ya, but it doesnt seem the correct way to call the macro

feral stone
#

wdym

digital sequoia
feral stone
#

a macro isnt something that goes continuesly, it is just blocks of code that can be run in small parts

#

put mouse over the thing and tell me what it says

digital sequoia
feral stone
#

hmm, gimme a min

#

ok i got it

#

replace RBX with TestService:Check_Equal() or smth like that

#

@digital sequoia

#

i think that is correct

digital sequoia
#

nop

feral stone
#

dang

digital sequoia
#

like with that u can call the normal :Check()

feral stone
#

also, why would you put the (1,2) in there, just asking

#

like if 1=2 or smth?

digital sequoia
#

I want to check how is the behavior

feral stone
#

so, how you would do it is

#

since testService is like a if or function

#

you can do as a test
*IN THE TESTSERVICE FUNCTION
TestService:Check(1 > 0, "CUSTOM ERROR MESSAGE IF FAILED")

#

@digital sequoia

#

do you got it?

#

ping me if you did

digital sequoia
#

wait a sec

digital sequoia
feral stone
#

np

#

that was painful to figure out 😮‍💨

digital sequoia
#

They didn't explain about it on the docs, it made more difficult 😭

feral stone
#

ye

#

i think that doc was for just to see the functions