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

How do I change this value to the name of the player?

Function(Player)
 local Insta = Instance.new((serverstorage,StringValue)
Insta.Name = Name
if serverstorage.Name then
Insta.Name = Name2
 game.serverstorage.Name.value =  player.UserID
end

^^This obviously doesn't work, but I was in a rush so uh, yeah, How do I get the name of the player into the value?

Help would be great TuT

1 answer

✓ Accepted answer

Well since this is going to be put into ServerStorage, it has to be in a Script, not a LocalScript.

Here is the code I would recommend:

game.Players.ChildAdded:connect(function(player)
	wait(1)
	local insta = Instance.new("StringValue", game.ServerStorage)
	insta.Name = player.Name
	insta.Value = player.UserId
end)

2 comments

0

Thank you kind sir.

0

Use Players.PlayerAdded, not Players.ChildAdded.

This discussion is preserved as it was. New answers, comments, and votes are closed.