Remote Event Not Firing

I’m trying to make a fist- fighting system and need to communicate between the client and the server to perform the hits, but the remote event won’t fire

Local Script


sp = script.Parent
local tool = sp
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local CombatEvent = game:GetService("ReplicatedStorage").CombatEvent

tool.Equipped:Connect(function()
	Mouse.Button1Down:Connect(function()
		print("punch")
		CombatEvent:FireServer("Punch")
	end)
	
	Mouse.Button2Down:Connect(function()
		print("block")
		CombatEvent:FireServer("Block")
	end)
	
	
	print("equipped")
end)


tool.Unequipped:Connect(function()
	print("unequipped")
end)

Server script located In ServerScriptService

local CombatEvent = game.ReplicatedStorage.CombatEvent

print("AAA")

CombatEvent.OnServerEvent:Connect(function(Action)
	
	if Action == "Block" then
		print("Blocked Successfully")
	end
	
	if Action == "Punch" then
		print("Punched Successfully")
	end
	
end)
1 Like

it is firing, but the first argument in the server-side connected function is the player that fired the event. “Action” in your code would be the player firing the event, which is never equal to any string.

CombatEvent.OnServerEvent:Connect(function(Player, Action)
3 Likes