I want to make a script that gives a StringValue your name unless someone elses name (on the server) already is the value.
COMMUNITY QUESTION
How do I reference every players name on the server?
2 answers
I'm guessing you want a random player for the server, and unless someones else's name is already on the server it will automatically choose one.
local StringValue = Instance.new('StringValue')
StringValue.Parent = game:GetService('Workspace') --//You Can Change this Destination\\--
local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
local plrname = randomPlayer.Name
if StringValue.Value == nil then
StringValue.Value = plrname
end
Nevermind I was just stupid you just say "if StringValue == nil then"
2 comments
0
That's what I put at first but then I edited it.
0
and it's StringValue.Value, please put that I answered your question so this forum can be closed.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Don't spoon - feed people @jayStepherdMD