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

Spawnpoint spawns me on the roof so I made a script and it doesn't work.What did I do wrong?

So I just placed a SpawnPoint in my building but it always spawns me on the roof whatever I do. So I made a script that would move the person that joins into the building.

So I went ahead and did that, but it doesn't work. The worst part is that it doesn't even say anything in the output.

My question is what did I do wrong?

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(225.502, 28.568, -236.095))
end)
end)

2 answers

✓ Accepted answer

dont listen to those people, they dont know what they r doing, just simply remove vector3.new thats it but keep the numbers so the script would be

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char.HumanoidRootPart.CFrame = CFrame.new(225.502, 28.568, -236.095)
end)
end)

1 comment

0

what cframe does is that it looks for numbers and not a cframe and a position of something is the numbers you need or as in ur script just use the numbers u want

This is a rather easy fix:

local spawnPosition = game.Workspace.SpawnLocation.Position
game.Players.PlayerAdded:Connect(function(player)
    player.Character.HumanoidRootPart.Position = spawnPosition
end)

Tell me if this works. If it does, accepting my answer is much appreciated :)

1 comment

0

It doesn't work...

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