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)
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