Hiya, everyone! :)
This is my first post on Scripting Helpers- Thank you for your time and effort!
I have made a script (with much assistance) that attempts to teleport players (upon respawn) to a random brick, aptly named one,two,three.. until ten! Unfortunately, in solo mode testing this script fails to do anything- Even when I remove the group checking. Where did I go wrong? How is this fixed? Thank you!
-Chimo
local spawns = {workspace.one, workspace.two, workspace.three, workspace.four, workspace.five,
workspace.six, workspace.seven, workspace.eight, workspace.nine, workspace.ten}
game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
wait(1)
if not newPlayer:GetRankInGroup(235869) == 2 then
wait(0.1)
newPlayer.PlayerGui.Choose:remove()
local db = spawns[math.random(1, #spawns)]
newPlayer.Character:findFirstChild("Torso").CFrame = CFrame.new(db.Position)
end end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)

4 comments
It still doesn't work, I am so confused! But thank you for helping! :D
Edited answer, try the new script.
Edit doesn't work 0.o I commend you for your assistance, however!
You're welcome, and edited again.