Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix FireServer can only be called from the client?

Asked by
Jo1nts 134
4 years ago
Edited by JesseSong 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

So Im making a script where when you click the water it fires a remote event and it keeps on saying FireServer can only be called from the client at line 9.How do I fix it?


local water = script.Parent local ReplicatedStorage = game.ReplicatedStorage local waterEvent = ReplicatedStorage:WaitForChild("RemoteEventWater") local cd = water.ClickDetector cd.MouseClick:connect(function(plr) print(plr.Name.." Has Clicked the water") water.Transparency = 1 waterEvent:FireServer() print("Server has been fired") end) while wait()do if water.Transparency == 1 then wait(45) water.Transparency =1 end end
1
change, script to localscript vinhthai00 1 — 4y
0
If you want to communicate between the same Script family, use the Bindable rendition Objects. Ziffixture 6913 — 4y
0
The error code is self - explanatory, you cannot call FireServer from a server only the local script! JesseSong 3916 — 4y
0
If you want to fire another server script, just use BindableEvents instead of RemoteEvents. You can't fire the server from the server. Using remote events you can fire from server to client or client to server. LightningLIon58 49 — 4y

Answer this question