#Call a function only when a condition is met

11 messages · Page 1 of 1 (latest)

serene drum
#

How would i succeed in doing this? (Look at the screenshot)

dusk coral
#

somecondition = true
thefunctionToRun()

serene drum
#

there are multiple npcs that spawn i tried it that way

dusk coral
#

whats the code supposed to do

serene drum
#

when an npc spawns, (every 10 seconds), they're placed inside a folder thats called "NPCS", when a proximity promt is triggered (thats inside the npc that spawned), they're taken out of that folder

#

the purpose of that is so that the next npc that spawns, checks if there are children more than 1 (which means there are npcs who havent been triggered by the proximity prompt), if there arent more children than 1 inside the folder, the function WalkHumanoid() is called

dusk coral
#

say it without saying code stuff

#

because im not getting you

serene drum
#

nvm, the problem was that it only checks once and it doesnt check again

#

so if he was inside a folder with another npc, he wont move, but when that npc gets removed, he wont check the statement again