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

Having problem with a simple "RemoteEvent", anything i can do to fix it?

I'm making a filtering enabled game which i'm not very familiar with so i was hoping i could get some help with this, I have no clue what could go wrong here.

I have a ImageButton that has a LocalScript inside of it, The LocalScript has a Script and a RemoteEvent in it

Inside of the LocalScript

script.Parent.MouseButton1Down:connect(function()
	script.RemoteEvent:FireServer()
end)

Inside of the Script

script.Parent.RemoteEvent.OnServerEvent:connect(function(player)
	player.Transformation.Value = "None"
end)

I have a script that creates a StringValue inside the player when the player joins

Layout of things in studio

Thank you for reading this i'm very grateful, Sorry if i made a stupid mistake haha.

2 comments

0

You should not need a remote event in a gui. It is common to use replicated storage to hold remote events. Lastly the script would not run in the starter gui or the players gui. It should be in server script service.

0

Thank you very much for answering my question, this worked.

1 answer

With FE on, scripts can not access playerguis. That means the server doesn't even know there is a remote event at that playergui (Due to that it can not access it) and the script won't run because scripts can not access the playergui.

Instead, place the RemoteEvent at "ReplicatedStorage" and give it a name.

LocalScript:

script.Parent.MouseButton1Down:connect(function()
    game.ReplicatedStorage.YourRemoteEvent:FireServer()
end)

Script (Place it at ServerScriptService for more security):

game.ReplicatedStorage.YourRemoteEvent.OnServerEvent:connect(function(player)
    player.Transformation.Value = "None"
end)

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