Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Error with my Event?

Error: 14:19:08.441 - ReplicatedStorage.RemoteEvent: OnClientEvent can only be used on the client

This is used in my script. Is OnClientEvent right?

2 comments

2

Post the script

0

event.OnClientEvent:connect(function(...)

1 answer

✓ Accepted answer

If you're using OnClientEvent be sure that you're using a local script. OnClientEvent fires when FireClient or FireAllClients is called from the server.

An example of what this interaction would look like:

--Server
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent:FireAllClients("Howdy")

--Client (local script)
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent.OnClientEvent:connect(function(arg)
	print(arg)
end)

This guide may also be useful if you need to know more: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial

3 comments

0

Can I give you a line of my script and let you look at it?

0

event.OnClientEvent:connect(function(...)

0

That line itself is correct, but without any context or script I can't say that the rest works.

This discussion is preserved as it was. New answers, comments, and votes are closed.