I am currently scripting a map-round shooter game and a script I made is acting up
local value = game.ReplicatedStorage.RoundOn
value:GetPropertyChangedSignal("Value"):Connect(function()
wait(1)
local spawnpoints = game.Workspace:WaitForChild("Map").Spawnpoints:GetChildren()
if value.Value == true then
for _, player in ipairs(game.Players:GetChildren()) do
local spawnpntnum = math.random(1,5) --getting what number spawnpoint to spawn at
local spawnpnt = spawnpoints[spawnpntnum] --transferring number value to spawnpart
print(spawnpntnum)
print(spawnpnt)
local humanroot = player.Character.HumanoidRootPart --getting humanoidrootpart
humanroot.CFrame.Position = spawnpnt.CFrame.Position -- not teleporting when suppost to
end
end
end)
this script is supposed to teleport the player to the chosen spawn part but instead it returns “Position cannot be assigned to - Server - PlayerTeleportWhenRoundStart/Die:13”