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

in a code i was following it had and under score after a word for example why do they do that?

Asked by 6 years ago
Edited 6 years ago

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local key = "player_".. player.UserId

1 answer

Log in to vote
1
Answered by
doomiiii 112
6 years ago

Your code is just building a String by concatenating ("combining") the left and right hand side of the "two dots operator" (..). The Lua Manual can help you with understanding it a bit more.

Basically, you want to brush up on your programming basics a bit more!

What you can do is try run this code and then check the Output tab, and maybe you get a better idea of it:

print("player_".. player.UserId)

Also note that you have not posted the entire code. The key ("player_".. player.UserId) is probably just a string that is used to store and identify some data associated with a given player in a table.

0
thx] xxbrobroxx02 13 — 6y
Ad

Answer this question