Remote event not firing from server to client

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? The remote event to work properly.

  2. What is the issue? It just doesn’t fire the function inside the remote event script…
    The remote event is parented under a script that is inside ServerScriptService.
    image

  3. What solutions have you tried so far? Yeah, I searched on the devforums and I found that I should use :WaitForChild() whenever I define the remote event but I did that already.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Here’s where the remote event gets fired:

elseif string.match(msg, "!announce") and table.find(AnnouncementWhitelist, plr.UserId) then
	print("Chatted !announce")
	GUIVisibility:FireClient(plr)
end

It prints it out so it’s obviously detecting the player chatted “!announce”.

Here’s the remote event script:

script.Parent.OnClientEvent:Connect(function(Player)
	print('Remote event functions.')
	local GUI = Player.PlayerGui:WaitForChild("CreateAnnouncement")
	GUI.Enabled = true
	GUI.Frame:TweenPosition(
		UDim2.fromScale(0.5, 0.499),
		Enum.EasingDirection.Out, 
		Enum.EasingStyle.Bounce, 
		1, 
		false
	)
end)

It doesn’t even print out that the remote event works.
It’s embarrasing to be stuck on such an easy issue :joy: Maybe I’m just losing brain cells.

for the onclientevent you should clientscript not the normal script

That’s what I’m doing:
image

You just said the root issue.
Any client can’t access or see the ServerScriptService.

But if you parent the LocalScript under the remote event that is inside the ServerScriptService, it should work?

How would a “local” script work inside that service?!

Okay so where should I parent it?

Try changing scripts location. For example, put the event into ReplicatedStorage.

You can parent the RemoteEvent anywhere it can be accessed by the client like ReplicatedStorage.
Also, put the local script inside the StarterPlayerScripts container.

But the remote event has to be fired by a server script and I don’t think a server script can access ReplicatedStorage (Also I just realized, RemoteEvents aren’t supposed to be in RS or SSS so I should put the event with the script into ServerStorage and it’ll work)
nevermind it doesn’t work

They actually can.

Thats wrong, they can be in ReplicatedStorage and that is the main container for anything that requires communication between the server and the client.

ServerStorage is a container for anything that isn’t related (directly) to the clients (clients aren’t allowed to access or see it).

Bro server scripts can access anywhere, put your RemoteEvent into the ReplicatedStorage and the local script into the StarterPlayerScripts. That will fix it. ReplicatedStorage is literally how the client communicates with the server

I put the remote event in RepStorage and it did not work.

Did you put the local script in that location?!

It appears you are uninformed, the Server in ServerScriptService stems from the fact that its descendants are not replicated to the Client(s). The Replicated in ReplicatedStorage is because its contents are replicated to both the Server and Client(s)

ReplicatedStorage is actually a common location for RemoteEvents to be kept.

You do know you have to change the referencing inside the scripts, right

Thank you all, I guess I was misinformed and I had a little confusion with remote events. I put the local script in StarterPlayerScripts and kept the remote event inside ReplicatedStorage and it worked. I’ll mark @wf_sh post as solved because he explained the most.

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