How do I make this variable work correctly? Putting a number manually works.
Hello. I have been trying to make a script clear your accessories and then load in your current roblox avatar accessories.
1 | local player = game.Players:FindFirstChild(username) |
2 | local playeruserid = player.UserId |
4 | print ( type (playeruserid)) |
6 | clearAccessories(character) |
8 | character.Humanoid:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(playeruserid)) |
The issue is the last line of the code not running correctly. If I replace the "playeruserid" variable with a userid manually, such as "1081709372" the script works fine. I can't figure out why, because using the two prints I can see that I get a correct userid in the variable and it is of the number type.
It should be the same as if I put it in manually, considering it's an ID in the number type?
I did try running the tonumber function prior to putting it in without success.