Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I reference every players name on the server?

I want to make a script that gives a StringValue your name unless someone elses name (on the server) already is the value.

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

1 comment

0

Don't spoon - feed people @jayStepherdMD

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.