when the player touch a part its starting from 60fps then drop to 10fps
local debounce = false
local debounce2 = false
local Stop = false
for i, v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Part" then
v.Touched:connect(function(otherPart)
if debounce == false then
print("God damn")
debounce = true
local hum = otherPart.Parent:FindFirstChild("Humanoid")
if hum then
local Player = game.Players:FindFirstChild(hum.Parent.Name)
game.ReplicatedStorage.OutBound:FireClient(Player, true)
Stop = false
if script:FindFirstChild(Player.Name) then
else
local Pl = Instance.new("StringValue", script)
Pl.Name = Player.Name
repeat
wait(1)
hum.Health = hum.Health - hum.MaxHealth / 100
until Stop == true
wait(2)
debounce = false
end
end
end
end)
v.TouchEnded:connect(function(otherPart)
if debounce2 == false then
debounce2 = true
local hum = otherPart.Parent:FindFirstChild("Humanoid")
if hum then
Stop = true
print("Oh god")
if script:FindFirstChild(hum.Parent.Name):Destroy() then
script:FindFirstChild(hum.Parent.Name):Destroy()
local Player = game.Players:FindFirstChild(hum.Parent.Name)
game.ReplicatedStorage.OutBound:FireClient(Player, false)
end
wait(2)
debounce2 = false
end
end
end)
end
end
