23:26:29.906 - Workspace.Main:9: attempt to get length of global 'SMode' (a userdata value)
Can anyone help me figure out why it's giving me this error?
OBS = game.ServerStorage.OBBIES StartingGui = game.ServerStorage.StartingGui PlayingGui = game.ServerStorage.PlayingGui ModeGui = game.ServerStorage.ModeSelect function SpawnNext() Character.Torso.Anchored = false local SMode = OBS.GameMode.Easy local Next = math.random(1, #SMode) Next.Parent = game.Workspace Next.PrimaryPart.CFrame = game.Workspace.Start.CFrame * CFrame.new(0,0,12) end function UpdateGame() local Start = OBS:FindFirstChild("Start"):Clone() Start.Parent = game.Workspace Character.Torso.CFrame = Start.Spawn.CFrame * CFrame.new(0,5,0) local PGui = PlayingGui:Clone() PGui.Parent = player.PlayerGui local MGui = ModeGui:Clone() MGui.Parent = player.PlayerGui local Find = OBS.GameMode PMode = player.Stats.Mode PMode.Changed:connect(SpawnNext) end function Joining(Player) local Stats = Instance.new("BoolValue",Player) Stats.Name = "Stats" local Round = Instance.new("NumberValue",Stats) Round.Name = "Round" local Mode = Instance.new("StringValue",Stats) Mode.Name = "Mode" local Playing = Instance.new("BoolValue",Stats) Playing.Name = "Playing" Playing.Value = false local SGui = StartingGui:Clone() SGui.Parent = Player.PlayerGui Character = game.Workspace:WaitForChild(Player.Name) Character.Torso.Anchored = true player = Player Player.Stats.Playing.Changed:connect(UpdateGame) end game.Players.PlayerAdded:connect(Joining)