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

How to repeat until it's gone?

I'm trying to make it so it would damage the player after some guis are gone but i don't know how to check if its gone

(i suck at scripting so :P)

Sever script:

game.ReplicatedStorage.yes.OnServerEvent:Connect(function(plranim,clonedclick,hum,atkred,dmg)
	if clonedclick then
	repeat wait() until not clonedclick
	else

	end
	hum:TakeDamage(atkred*dmg)
end)

1 answer

✓ Accepted answer

To check if something is gone you want to use a function called :FindFirstChild(). This function will return a path or nil depending on if it finds the specified object. Example:

local p = Instance.new(“Part”, workspace)
p.Name = “test”
print(workspace:FindFirstChild(“test”))
--> prints test’s path
p:Destroy()
print(workspace:FindFirstChild(“test”))
--> prints nil

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