I've done this but its not working? no errors. not working in studio nor server?
Player.CharacterAdded:connect(function()
Player.Character:MoveTo(GetTycoon().BasePlate.Position + Vector3.new(0,10,0))
end)
I've done this but its not working? no errors. not working in studio nor server?
Player.CharacterAdded:connect(function()
Player.Character:MoveTo(GetTycoon().BasePlate.Position + Vector3.new(0,10,0))
end)
Other than the fact that Player wasn't defined in the question, your problem is that the Character has not loaded yet.
You should wait until the HumanoidRootPart has loaded using the WaitForChild function, and then CFrame it.
######note: remember to use variables to keep your code clean and concise!
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:connect(function(c)
local h = c:WaitForChild("HumanoidRootPart")
local target = GetTycoon().BasePlate.Position
local offset = Vector3.new(0,10,0)
h.CFrame = CFrame.new(target + offset)
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
GetTycoon() is a function i made that gets the player's tycoon