Would this gui affect everyone? Or will it just appear for the player?

So, I have made a leaderstats script, but I am very unsure if this gui will pop up for everyone even though I just want the person that reached a certain integer getting the gui. But, I am unsure if the gui will pop up for everyone. script:

Edit: script is located on serverScriptService

1 Like

You can’t make a GUI appear on the server… A common method I use is firing an event back to the player.

event:FireClient(player)

Then in the GUI script I’d do

event.OnClientEvent:Connect(function()

GUI.TextLabel.BackgroundTransparency = 0
GUI.TextLabel.TextTransparency = 0
wait(3)
GUI.TextLabel.BackgroundTransparency = 1
GUI.TextLabel.TextTransparency = 1
end)

Not the most professional way, but easy for a quick and easy way.

So, it doesn’t appear for everyone? If so, thank you so much, and my gui does work

Only people who respawn (assuming you don’t have ResetOnSpawn disabled) will see those changes.

If you want to update the GuiObject for every person, their copy of the ScreenGui is in each player’s PlayerGui so you’ll have to update it for each player (although anything cloned from StarterGui cannot be seen by the server!).

1 Like

Nope! As long as you follow the way I did it should only appear for that certain player.

1 Like

Also make sure you disable ResetOnSpawn for the GUI.

Also, could you please explain your method? I don’t want to use a script without knowing what it does.

Basically,

You’d need to create a RemoteEvent in ReplicatedStorage. A RemoteEvent is a way to send information to the Server or Client. (Read more about sending RemoteEvents to the client: here.

When firing the RemoteEvent to the Client, you’d make a script that receives the RemoteEvent from the server.

When the Client detects that the Event was received it will run the function that the script has told it to do.

(TL:DR) So in conclusion, it receives the event from the server and runs the function that the script has told it to do.

2 Likes