RemoteEvent work sometime!

  1. What do you want to achieve? Keep it simple and clear!

I want to make my character run when he click with a script in the server side.

  1. What is the issue? Include screenshots / videos if possible!

The code work sometime and it had no error !!

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I don’t know what to do but I think the solution is with RunService but I don’t understand how to use it.
Sorry for my English, I’m French.
Thanks for the time you have take to reading this.

Here my code

In a localscript which is in a Tool

local Player = game.Players.LocalPlayer
local Tool = script.Parent
local Mouse = Player:GetMouse()

local EquipperToolFantome1 = false
local EquipperToolFantome2 = false

Tool.Equipped:Connect(function()
	EquipperToolFantome1 = true
	EquipperToolFantome2 = true
end)

Tool.Unequipped:Connect(function()
	EquipperToolFantome1 = false
	EquipperToolFantome2 = false
end)		

Mouse.Button1Down:Connect(function()
	if EquipperToolFantome1 == true and EquipperToolFantome2 == true then
		EquipperToolFantome1 = false
		game.ReplicatedStorage.RemoteEvent:FireServer(Tool)		
		wait(2.5)
		EquipperToolFantome1 = true
	end	
end)

In a script which is in SeverScriptService

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, Tool)

        local EquipperToolFantome1 = true
	local EquipperToolFantome2 = true

	Tool.Equipped:Connect(function()
		EquipperToolFantome1 = true
		EquipperToolFantome2 = true	
	end)


	Tool.Unequipped:Connect(function()
		EquipperToolFantome1 = false
		EquipperToolFantome2 = false	
	end)
	
	if EquipperToolFantome1 == true and EquipperToolFantome2 == true then
		EquipperToolFantome1 = false
		player.Character.Humanoid.WalkSpeed = 25
		wait(1)
		player.Character.Humanoid.WalkSpeed = 16
		wait(1.5)
		EquipperToolFantome1 = true
	end

end)

game.ReplicatedStorage.RemoteEvent:FireServer(ToolFantome)

You never defined ToolFantome. Did you mean to put Tool there?

local player = player

No need to define player again.

The whole server script is a bit messed up. You’re setting two values to true, then checking if they’re true or not.

Yes I forgot to change it when I translate my code in english.

And I need to put the two variable for an “effect”. But the script work always sometime.

Okay I find the solution. I have create the remote event two time with the same name. So sometimes the local script and script used the same remote event to communicate and it was working and the other time they used each one a different remote event to communicate and it wasn’t working. Sorry for my English I’m French.