Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a code to keep checking a function?

Im trying to make a script that will activate certain commands once a model is gone. It works when I test the game without the model to begin with, but when I test the game with the model and then remove it, the script wont activate the commands. Correct me if I'm wrong, but I think its because it only checks to see if the model is there or not one time in the beginning.

So I want to know how to code it to make it constantly check if it's there or not.

local disaster = workspace:FindFirstChild ("Disaster Script")
local humanoid = workspace:FindFirstChild("Soldier")
local serverStore = game:GetService("ServerStorage")

function Win()
	m = Instance.new("Hint")
	m.Parent = game.Workspace
	m.Text = "You Win! [Restarting...]"
	wait(5)
	m:Remove()
end

if humanoid == nil then
	disaster.Parent = serverStore	
	print (Win())
	wait ()
	disaster.Parent = workspace
end

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.