Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont this r15 allowing teleportation script work!?


local availableSpawns = {}

for i,v in pairs(game.Workspace.Spawns:GetChildren()) do
    table.insert(availableSpawns, v)
end
for i,v in pairs(game.Workspace.Spawns:GetChildren()) do
    v.Taken.Changed:connect(function()
        if v.Taken.Value == true then
            table.remove(availableSpawns, v)
        else
            table.insert(availableSpawns, v)
        end
    end)
end

game.Players.PlayerAdded:connect(function(plr)
    repeat wait() until plr and plr.Character
    local spawn = availableSpawns[math.random(1, #availableSpawns)]
	local Torso =  plr.Character.UpperTorso or plr.Character.Torso
	Torso.CFrame = CFrame.new(spawn.Position)
	
    spawn.Taken.Value = true
end)

it checks uppertorso then leaves so when I test with r15 it works but when I test with r6 it doesnt

2 answers

Why don't you get the model of the player and get the primary part because what I was told r15 does not always the exact resources.

Use Player.Character.HumanoidRootPart instead. Not much i can add to this.

This discussion is preserved as it was. New answers, comments, and votes are closed.