RemoteEvent not firing to client

LocalScript (StarterPlayerScripts):

local event = game.ReplicatedStorage.CameraEvent
-- removed more stuff that isnt needed

local function onReceived()
	print("event fired")
	-- unnecessary stuff removed
	print("should be visible....")
end

event.OnClientEvent:Connect(onReceived)

Server (ServerScriptService):

local event = game.ReplicatedStorage.CameraEvent

local function onReceived(plr)
-- uneccesary stuff gone again
		if speedover <= 10 then
			event:FireClient(plr,amounts.amount1, limit, speed)
			print("1")
	end
end

event.OnServerEvent:Connect(onReceived)

I know the server script is running due to the presence of several print checks running - all of them work, until its transferred to the client. Any help appreciated.

2 Likes

Where are you firing the event from?

Edit: event.OnServerEvent wont work because the client is never firing an event

1 Like

There’s 3 scripts involved, as I said, I know the function shown is running - if you read the entire post you would be aware.

1 Like

And as also stated in the post, it’s being fired from ServerScriptService
Edit: the third script, not shown, is in PlayerGUI

1 Like

Does the third script have any relation to the event?

It fires the event to trigger the server, sure. Apologies for the tart response, but we’re getting off topic - the issue is the localscript in StarterPlayerScripts isn’t running when the event is fired, not anything else.

Try

local function onReceived(amounts, limit, speed)
	print("event fired")
	-- unnecessary stuff removed
	print("should be visible....")
end

Not putting the parameters might be the problem

Didn’t make a difference
(character limit…)

Try changing line 1 of the LocalScript to:

local event = game:GetService("ReplicatedStorage"):WaitForChild("CameraEvent")

The RemoteEvent might need time to load.

2 Likes

Yep, thats done it, thanks.
(character limit)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.