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

RemoteEvent passes "player" as a function parameter, but doesn't recognize it inside the function?

Roblox makes it so when a RemoteEvent is fired, the first parameter is automatically set to the player who fired it I think, defined as "player". So when I use that parameter inside the function, I feel like the script does not recognize it and does not make the GUI visible for the player who fired the event.

game.ReplicatedStorage.OpenShop.OnServerEvent:Connect(function(player)
player.PlayerGui.ScreenGui.Frame.Visible = true
end)

Any solutions to this problem? I appreciate the help.

2 comments

0

You don't include the player parameter on firing the remote. Also, you're trying to modify the PlayerGui from the server, which is bad practice.

0

isn't that what you're supposed to do with FE?

1 answer

✓ Accepted answer

The problem is not your player argument, your problem is that the server cannot control anything in PlayerGui when FE is enabled (as incapaz said). You have to be 100% reliant on the client for changes to any of the UI elements. This is done so no tampering can go on between UIs

1 comment

0

you right

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