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

Attempting to locate vehicle with Player's name in workspace?

My problem is getting a script (Located in PlayerGui) to find a vehicle in workspace (Uses A-Chassis so it's named [PlayerName]'s Car). Any help would be appreciated, as my scripting capabilities are not at this level yet, and if you have any useful tutorials regarding this topic, please share.

1 comment

0

Please provide the relevent scripts.

1 answer

✓ Accepted answer

I would've preferred that you attempt this, but considering how easy this is, I will answer it anyway.

local player = game.Players.LocalPlayer
local x = player.Name
local vehicle = workspace["[" .. x .. "]'s Car"]

To concatenate strings, you use two dots like I have above, and because the vehicle's name also contains a space in it, the normal dot operator won't work so you would have to do workspace["name"] without a dot operator.

Since this answers your question, mark it as the accepted answer. Also read this https://scriptinghelpers.org/about before asking your next question.

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