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

Why can't I find what a players car name is?

Asked by 6 years ago

In my game I'm adding a car customizer. When you spawn the car its the players name then an s. EG: 'kittonlover101s' I know how to get the players name, but how do why is the s not being added to the variable? Any help would be appreciated!

local character = game.Workspace:FindFirstChild(playername + 's')

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
(playername + 's') -- Incorrect

+ does not function like that

You need to do .. instead; .. is the concatenation operator.

Correct format:

local character = game.Workspace:FindFirstChild(playername .. 's')
0
Thanks, worked perfectly. kittonlover101 201 — 6y
0
You're welcome! sweetkid01 176 — 6y
Ad

Answer this question