I want to display points on screen momentarily as they are awarded to a player.
I have a module script (in ServerStorage) that handles awarding points when a player passes through a points part. Wanted to display the points as a text label in StarterGui, but of course, the module script (server), can’t control the GUI (local).
Was trying to set the GUI’s enable or visible to “true”, i.e. game.StarterGui.pointsLabel.Visible = true, but of course, this won’t work. I have searched but didn’t find this issue in the Dev Forum.
It doesn’t make sense in this case to put a local script in this StarterGui, because I can’t see any way it can listen for the event that should trigger points, which is the player passing through a points part. This event, in turn, fires a function in a PointsController module script, which triggers a sound FX, gets players current points, checks for 2X or 4X game passes, and triggers a ParticleEmitter. Would like this script to then include showing the points on screen, but as stated above, we have the issue of a server script not being able to talk to a local script.
You can grab the PlayerGui using Player.PlayerGui which will handle your third method. StarterGui doesn’t change what the players will see at the moment, it will just change how the GUIs are when the player spawns (and will affect all players).
You could also just fire a RemoteEvent with the points after you’ve done all those checks and have a local script listen to it.