FireClient() not working

I want to make it so my FireClient() works properly but for some reason its not working. I’m not recieving any errors after firing the event.

Script
local RemoteEvent = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)

script.Parent.ClickDetector.MouseClick:Connect(function(Player)

RemoteEvent:FireClient(Player)

end)

Local Script

local RemoteEvent = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)

RemoteEvent.OnClientEvent:Connect(function()

print(“test”)

end)

1 Like
do you mean?
--Script
local RemoteEvent = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)

script.Parent.ClickDetector.MouseClick:Connect(function(Player)

RemoteEvent:FireClient(Player)

end)

--local script
local RemoteEvent = game.ReplicatedStorage:WaitForChild(“RemoteEvent”)

RemoteEvent.OnClientEvent:Connect(function()

print(“test”)

end)

this works in a local script
no need for a remoteEvent

The problem is, if you put in local script, hackers can mess it up and activate from anywhere

making the server specify the clickable point will prevent that, and if the server notice something sus, it will not work, except if, the server has some great sanity checks already knowing that this would happen

Works perfectly fine when I test it.

Could have something to do with the placement of your local script.

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

  • A Player’s Backpack , such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts .
  • The ReplicatedFirst service
2 Likes