RemoteEvent not running for some reason

Signal from remote event isn’t received on the server

//Simplified Server Script

local Activate_Pickaxe_Event = game:GetService("ReplicatedStorage").Events.RemoteEvents.Activate_Pickaxe_Event

Players.PlayerAdded:Connect(function(Player)
	
	Player.CharacterAdded:Connect(function(Character)

		local TouchingParts
		local ClickCooldown = false
		local debounce = false

		Activate_Pickaxe_Event.OnServerEvent:Connect(function(plr)
			print("received")
        end)
    end)
end)

//Full Client Script

local Pickaxe = script.Parent

local Activate_Pickaxe_Event = game:GetService("ReplicatedStorage").Events.RemoteEvents.Activate_Pickaxe_Event

local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local MineAnimation = Pickaxe:FindFirstChild("MineAnimation")
local LoadedAnimation = Humanoid:LoadAnimation(MineAnimation)

local AnimationDebounce = false


Pickaxe.Activated:Connect(function()
	if not AnimationDebounce then
		AnimationDebounce = true
		Activate_Pickaxe_Event:FireServer()
		LoadedAnimation:Play()
		task.wait(0.4)
		AnimationDebounce = false
		print("fired")
	else 
		return 
	end
end)

Explorer:
image

Output:

Issue: “received” doesnt get printed, so the OnServerEvent doesnt run

Thank you

try this server script

local Activate_Pickaxe_Event = game:GetService("ReplicatedStorage").Events.RemoteEvents.Activate_Pickaxe_Event

Players.PlayerAdded:Connect(function(Player)
	
	Player.CharacterAdded:Connect(function(Character)

		local TouchingParts
		local ClickCooldown = false
		local debounce = false

    end)
end)
Activate_Pickaxe_Event.OnServerEvent:Connect(function(plr)
	print("received")
 end)

sometime CharacterAdded is not fired when first join player

Try printing something inside the .CharacterAdded block of code (not inside the .OnServerEvent though) and see if it prints once you join.

1 Like