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

Error with printing a players lobby?

Asked by 7 years ago

The goal is the give a player their own spawn box, and in the workspace there is Lobby1 through Lobby10. But the issue is, the i try to get this lobby through a value with a number, 1 - 10,i get the error : attempt to concatenate local 'lobbys' (a userdata value)

player = game.Players.LocalPlayer
local spawn = script.Parent.spawn
local lobbys = game.Workspace.Lobbys
local locallobby = lobbys..spawn.Value
wait(1)
spawn.Value = game.Workspace.Values.Numspawns.Value
print(locallobby)
player.Character:MoveTo(Vector3.new(0,0,0))

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

On line 4 you're concatenating an object with a string, which will error. To fix this you'll have to change "lobbys..spawn.Value" to "lobbys.Name..spawn.Value"

Ad

Answer this question