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

Error with printing a players lobby?

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

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"

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