Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to repeat until it's gone?

Asked by 5 years ago

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

Log in to vote
0
Answered by
poke7667 142
5 years ago
Edited 5 years ago

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
Ad

Answer this question