Best way to store the players variable in a server script in a gui

SOMEONE IN SCRIPTERS HELPERS SOLVED THIS
“”
– Script → Frame → ScreenGui → PlayerGui → Player
local player = script.Parent.Parent.Parent.Parent
“”

Btw i’m new so I’m not up to speed of how this works
Updated explanation:
I have a zombie spawner which is also inside a text label the script is a server script. I have made an if statement so that if a players string value = 1 then the code runs so I need to get the players variable to run this piece of code
“”
if plr.Map.Value == 1 then
“”

I need to store the players variable. Should I try remote events? Basically I need to get a players variable inside a server/normal script inside a text label which is inside a gui

while true do





    wait(1)

    script.Parent.Text = "Pick a map"






         if plr.Map.Value == 1 then -- I need the players variable to do this


                if game.Workspace.Wave.Value == 1 then
                -- the rest of my code this is a snipet to show u
-- I know there isn't any ends here

Post is pretty vague, what is the players variable? don’t understand anything from your topic right now.

Basically I want to store the players value for example
something like this to get the players variable stored
“”
game.Players.PlayerAdded:Connect(function(plr)
“”

Oh, I get you now, what about just adding in a player added event? like you said?

can you explain what script.Parent is?

I tried the player added but it didn’t work

The script is in a text label.

TextLabels cannot be edited by a server script, so you’d have to fire a remote event for the text to show to everyone. Change the script into a local script and access the player by game.Players.LocalPLayer

edit: I withdrawed it. please don’t flood replies like that. it is considered spam.

I can’t bc the script clones zombies so that wouldn’t work

I replied to your question I didn’t flood replies

I am having a hard time trying to understand what you are trying to do here. Could you maybe give me some more detail?

Are you trying to use a text label to show how much currency a player is holding onto?

Btw instead of repeatedly making replies, you can simply click the pencil icon to edit your post.

Just clone the zombies through the remote event. You need to change it into a localscript.


you did.

wasn’t relevant to the topic at all. if you want to argue, do it in dms.