I am currently working on a bit of an animation of sorts that uses remote events triggered by a touch interest. The script for calling the remote event goes as follows, mind you that this is a local script
I would first of all recommend you to remove the parameter “game.Players.LocalPlayer” when firing the event. It’s a client → server event so the player variable is passed automatically. The parameter is just an unnecessary payload.
local froggies = {}
local debounceTable = {}
for i = 1, 8 do
froggies[i] = game.Workspace.ragdoll["ragdollfroggy" .. i]
end
for _, froggy in pairs(froggies) do
froggy.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr and not debounceTable[froggy] then
debounceTable[froggy] = true
game.ReplicatedStorage.kevent:FireServer(plr)
wait(5)
game.ReplicatedStorage.effectk:FireServer(plr)
debounceTable[froggy] = false
end
end)
end