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

I'm trying to make a spawn script and it WON'T move the part?!

Asked by 4 years ago

I'm just trying to spawn the character at a cylinder and this is the code on the server:

game.Players.PlayerAdded:Connect(function(player)

    player.CharacterAdded:Connect(function(char)

        local humanoidRootPart = char:WaitForChild("HumanoidRootPart")
        local area = game.Workspace:WaitForChild("GameContent")
        local mainArea = area:WaitForChild("WaitingArea")

        humanoidRootPart.CFrame = CFrame.new(mainArea:WaitForChild("Spawn").Position)
    end)
end)

1 answer

Log in to vote
1
Answered by 4 years ago

Instead of just CFrame.new, do

CFrame.new(Vector3.new(mainArea:WaitForChild("Spawn").Position))
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
That's what I'm doing...? CataclysmicDev 46 — 4y
View all comments (5 more)
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
That's what I'm doing...? CataclysmicDev 46 — 4y
0
You forgot the Vector3.new part e6_4KOkGsp 40 — 4y
0
If that doesn't work then put a wait(1) or something like that at the start of the CharacterAdded script, you might be trying to teleport the player before the humanoidRootPart is in the correct position. e6_4KOkGsp 40 — 4y
Ad

Answer this question