Fire Client doesn't fire "FireClient can only be called from the server"

  1. What do you want to achieve? Keep it simple and clear!

For my local-script inside my shop to fire off a Remote Event inside Replicated Storage
using

game.ReplicatedStorage.HatchEgg:FireClient(player)
  1. What is the issue? Include screenshots / videos if possible!

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

solution I’ve tried was to change the script
to a fire-server instead and remove the player tag but that wouldn’t fire the remote event either, I read that you can’t put a fire client in a local script but I don’t know how to replace it

You can’t use :FireClient from a local script. Try using :FireServer and see if that fixes your problem

I did try Fireserver() and now fileserver(player,pet) neither of them seem to fire off the Event. 0 errors inside output after switching

It is FireServer() not FireClient()

game.ReplicatedStorage.HatchEgg:FireServer()

still won’t fire off the event HatchEgg in ReplicatedStorage

You have to make the OnServerEvent in a server script for the “:FireServer()” but for OnClientEvent you have to put it in a local script and put “:FireClient()” in the server script.

my OnClientEvent was inside a local-script in StarterGui

game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = studio.CamPart.Cframe

I just tried changing it to

game.ReplicatedStorage.HatchEgg.OnServerEvent:Connect(function(pet)

which gave me error

“OnServerEvent can only be used on the server”

guessing because It’s inside a local-script but :fireclient wasn’t starting either

OnServerEvent can only be used in a SERVER SCRIPT try using that and then USE the “:FireServer()” ON the LOCAL SCRIPT

1 Like

At this case you should use Bindable Events instead.

Remote events are for client - server communication or server - client communication.

Remote functions are for client - server - client or server - client - server communication.

Bindable events are for client to client or server to server communication.

Bindable functions are for client to client to client or server to server to server.

Basically: Remotes communicate client and server, Bindable passes information from scripts of the same type to other scripts of the same type.

BindableInstances should be used instead of RemoteInstances, BindableInstances, unlike RemoteInstances, only allow script messaging on the current script context environment (Script boundary - Server/Client/Core/Edit/Studio/Plugin). While RemoteInstances allow script messaging across the CoSE (Client/Server boundary). Use this to your advantage good sir!