Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this spawn script not work, i`m very bad when it comes to position?

Asked by 2 years ago
Edited 2 years ago
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:connect(function(char)
        if char then
            char.HumanoidRootPart.CFrame = CFrame.new(38.552, 0.5, 119.404)
            print('Worked')
        end

    end)

Basically i want the player when it spawns to teleport automatically to a part, it still goes weird.

0
BTW, it prints worked too, but my player still doesn`t teleport at all. Hate_ZEU 47 — 2y
0
What i do, is just place a block, turn off its can collide and make it transparent. put that block wherever you want the player to be teleported. and be like: char.HumanoidRootPart.Position = block.Position Carlowskey 20 — 2y
0
i FIND my idea more organized because if you move your map around, and maybe you want em to spawn somewhere else, all u gotta do is move that block lol Carlowskey 20 — 2y
0
It`s still not working Hate_ZEU 47 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago

runservice works for me whenever i try any of this

local svrun = game:GetService("RunService")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
svrun.Stepped:Wait()
if char then
local root = char:WaitForChild("HumanoidRootPart")
root.CFrame = CFrame.new(38.552, 0.5, 119.404)
print('Worked')
end
end)
Ad
Log in to vote
0
Answered by 2 years ago

Can't you just use a spawn location from the toolbox? And just make it transparent and cancollide = true aswell as deleting the decal will make it compeletly invisible aswell as teleporting the player when they join.

0
I want to make checkpoints for an obby, and i thought i could make a system that if player has stage 2 then when he joins the game he teleports at the part that require stage 2, i hope you understand what i`m saying, and the script from the other guy that commented doesn`t work when i join ,idk why Hate_ZEU 47 — 2y

Answer this question