So here is the code accessing the local script~
1 | player.PlayerGui.ChangeMoneyGui.RemoteClient:FireClient() |
and here is the code receiving the event.
1 | local player = game.Players.LocalPlayer |
2 | script.RemoteClient.OnClientEvent:connect( function () |
3 | player.PlayerGui.Money.Money.Text = "Money: " .. player.leaderstats.Money.Value |
4 | end ) |
Anytime I try to call the event I get the error "Argument 1 missing or nil". All the code seems fine so what's the issue. The first script is a script inside workspace. The second is a local script within the players GUI.
It's because your script that is located on the server is confused on which client to send its request to.
Try this:
player.PlayerGui.ChangeMoneyGui.RemoteClient:FireClient(playerName)