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

I've got a problem with Remote Event. Any help?

Hi! I have a problem with making a remote function event. I did a script that fires the event when I touch the brick: (located in ServerScriptService)

local event = game.ReplicatedStorage.RemoteEvent

workspace.Part.Touched:Connect(function()
	event:FireAllClients()
	print("serverWorks")
end)

and the OnClientEvent LOCAL script

local event = game.ReplicatedStorage.RemoteEvent

event.OnClientEvent:Connect(function()
	print("clientWorks")
end)

The problem is that it only prints "serverWorks"

Thank you for every answer :]

5 comments

0

Is that both the complete scripts ?

0

yeah

0

Where is the localscript located?

0

Its in the workspace

0

try putting the localscript in starterplayer scripts

1 answer

✓ Accepted answer

LocalScripts cannot run in workspace. They can run only in player's backpack, player's character, PlayerGui, PlayerScripts and a ReplicatedFirst Service

So try putting it inside starterplayer scripts or playergui, and then it should work.

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