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

4 comments
change, script to localscript
If you want to communicate between the same Script family, use the Bindable rendition Objects.
The error code is self - explanatory, you cannot call FireServer from a server only the local script!
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.