Hello I ran to this problem with this script, I keep getting this error. What im trying to do is basically make the player spawn at a certain place.
Module Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local Teams = game:GetService("Teams")
local PlayerManager = require(ServerScriptService.Data.PlayerManager)
local spawnLocations = game.Workspace.JobSpawns
local Shack = {}
Shack.__index = Shack
function Shack.New(Player)
local self = setmetatable({}, Shack)
self.Employee = Player
self.Job = Player.Team
return self
end
function Shack:jobSpawns(jobLocation)
local fVar = ""
local Data = {
["1"] = spawnLocations.Manager,
["2"] = spawnLocations["Assistant Manager"],
["3"] = spawnLocations.Supervisor,
["4"] = spawnLocations.Chef,
["5"] = spawnLocations.Janitor,
["6"] = spawnLocations.Cashier,
}
if jobLocation == "Manager" then
fVar = Data["1"]
end
if jobLocation == "Assistant Manager" then
fVar = Data["2"]
end
if jobLocation == "Supervisor" then
fVar = Data["3"]
end
if jobLocation == "Chef" then
fVar = Data["4"]
end
if jobLocation == "Janitor" then
fVar = Data["5"]
end
if jobLocation == "Cashier" then
fVar = Data["6"]
end
return (fVar)
end
function Shack:Init()
local Job = self:jobSpawns(self.Job)
self.Employee.RespawnLocation = Job
self:LoadCharacter()
end
return Shack