hello
I have a very annoying little problem, actually I have a death animation (not finished) but actually if the brick that kills the player stays in contact with a member of the player, the script repeats itself without stopping, it's very annoying
server-side script
local Brick = script.Parent
local repstorage = game:GetService("ReplicatedStorage")
local Remote = repstorage:WaitForChild("RemoteKill")
--End--
--Code--
local function PlayerTouch(Part)
local Parent = Parent Share
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = 0
for i,v in pairs(game.Players:GetChildren()) do
Remote:FireClient(v, v.Name)
end
end
end
Brick.Touched:connect(PlayerTouched)
local script
-----------------------------------------------------------------------------------------------------------------
local repstorage = game:GetService("ReplicatedStorage")
local remoteKill = repstorage:WaitForChild("RemoteKill")
local sound = game:GetService("Players")
remoteKill.OnClientEvent:connect(function(playerName) --[[playerName is (v.Name) that you fired from server]]--
sound = game.Players[playerName].PlayerGui.Sounds
sound.Chase:Stop()
sound.Killed:Play()
print(playerName..." has been killed by Sonic.EXE")
end)
Is there any way to make the OnTouch disabled?

1 comment
Use a debounce