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
Qin2007
(Qin2007)
November 16, 2021, 3:48pm
#2
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)
JalenBoston:
ClickDetector.MouseClick
this works in a local script
no need for a remoteEvent
Moleza
(Moleza)
November 16, 2021, 3:52pm
#3
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
bnxDJ
(bnx)
November 16, 2021, 4:07pm
#4
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
3 Likes