Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I fix userId?

Asked by 9 years ago
script.Parent.Text = (game.Players.LocalPlayer.Name.. "'s UserID is ".. game.Players.LocalPlayer.FollowUserId)

The text is supposed to say your name, and your Id, but it tells you your ID is 0 any help?

1 answer

Log in to vote
1
Answered by
DataStore 530 Moderation Voter
9 years ago

The property you're attempting to concatenate will always be 0 unless the user in question followed another user into the game, in which case the property will be equal to the userId of whoever they followed.

You should be 'reading' the userId property to get their userId.

http://wiki.roblox.com/index.php?title=UserId

local Player = game.Players.LocalPlayer
script.Parent.Text = Player.Name .. "'s UserID is " .. Player.userId
Ad

Answer this question