```lua function module.teleport(plr, location) local registered = split(script.Registered.Value, ",")
local exists = false for _,i in pairs(registered) do if exists ~= true then exists = i == location end end print(exists) if exists then location = registered[location] local position if location:IsA("BasePart") then position = location.Position else error("Models are not supported as a viable LocationPart. Use a BasePart instead.") return end if plr:IsA("Model") and plr.Parent == workspace and game.Players:FindFirstChild(plr.Name) then plr:MoveTo(position) else error("You did not provide a valid object. Valid objects must be a child of game.Workspace, must be a model, and must have a counterpart in game.Players.") return end else error("LocationPart \""..location.."\" does not exist.") return end
end ```
This code keeps giving an error and I just can't seem to find out the issue: ``` true
15:03:24.186 - ServerScriptService.TeleService:47: attempt to index local 'location' (a nil value) 15:03:24.187 - Stack Begin 15:03:24.187 - Script 'ServerScriptService.TeleService', Line 47 - field teleport 15:03:24.188 - Script 'ServerScriptService.TeleService', Line 74 15:03:24.188 - Stack End ```