Any idea why this will not work?
local players = game:GetService("Players") local spawnParts = workspace:WaitForChild("SpawnPs") local spawns = spawnParts:GetChildren() game.workspace.GameStats.GameRunning.Changed:Connect(function() if (game.Workspace.GameStats.GameRunning == true) then for _, player in next, players:GetPlayers() do local torso = player.Character and player.Character:FindFirstChild("Torso") if torso then local randomCF = spawns[math.random(#spawns)].CFrame torso.CFrame = randomCF end end end end)
Any help is appreciated!
I assume GameRunning
is a BoolValue object. If that's the case, then on line 6, you have GameRunning == true
. You should make it be GameRunning.Value == true
. Remember that GameRunning
is not true or false, its an instance of BoolValue.
game.Workspace.GameStats.GameRunning == true
should be game.Workspace.GameStats.GameRunning.Value == true