Im trying to teleport a player around a object but i cant get it to work this was my original code (which failed very bad):
function TPPlayer(player, part)
player.Character.HumanoidRootPart.Anchored = true
local RandomOriX = math.random(-360, 360)
local RandomOriY = math.random(-360, 360)
local RandomOriZ = math.random(-360, 360)
player.Character.HumanoidRootPart.Orientation = Vector3.new(-90 , -90, -90)
player.Character.HumanoidRootPart.Position = Vector3.new(part.Position.X, part.Position.Y * part.Size.Y / 2 - 5, part.Position.Z)
end
I then tryed this code but it just doesnt do it right: (this is what happens)
function TPPlayer(player, part)
player.Character.HumanoidRootPart.Anchored = true
local playerpos = player.Character.HumanoidRootPart.Position
local partpos = part.Position
player.Character.HumanoidRootPart.CFrame = CFrame.new(partpos,playerpos) * CFrame.new(0,0,5)
end
The way i want it is so the player is randomly teleported around the object, so one tome you could be on top of the ball / next you could be underneath it or on left right etc.
i will take any help given!

1 comment
LookVector, RightVector, and UpVector.