script.Parent.ClickDetector.MouseClick:Connect(function(player) game.ReplicatedStorage.RemoteBuy:FireServer() end)
When I click the part it says that Client Can't call FireServer. I tried changing it to local Script, but it didn't work
I believe what you want is FireClient. Assuming you have a local script ready to be executed OnClientEvent
then:
script.Parent.ClickDetector.MouseClick:Connect(function(player) game.ReplicatedStorage.RemoteBuy:FireClient(player) end)
Best of luck developer! Hoped this helped!
Btw you might have messed up the order. The local script should be OnClientEvent
. Not OnServerEvent