Remote event failing to fire

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

script.Parent.Touched:Connect(function(hit)
	game.ReplicatedStorage.kevent:FireServer(game.Players.LocalPlayer)
	wait(5)
	game.ReplicatedStorage.effectk:FireServer(game.Players.LocalPlayer)
end)

The script that triggers when the remote event fires works perfectly, I even called the event through a seperate localscript using a regular

game.ReplicatedStorage.effectk:FireServer(game.Players.LocalPlayer)

pretty sure that LocalScripts can’t run in workspace

Any possible workarounds you would suggest?

The only way they can run in the workspace is if you put them inside StarterCharacterScripts

drop the script inside StartCharacterScript, should work at its current state

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

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.