Hey,
I'm trying to do the following script: http://wiki.roblox.com/index.php?title=How_To_Use_BodyPosition
I'm setting it to a button click so that when you press your mouse, it jumps into the sky (0, 500, 0), however it puts the player in the middle of the map (obviously because of the 0 values). I'm wondering how I can get the players X and Z values so that it just goes up, rather than centers and then up.
Thanks
Edit to an answer:
Assuming you are using the code from the onTouched
function defined on the the wiki page, you can get the position of the character this way:
local character = hit.Parent if character and character:findFirstChild("Humanoid") then local b = Instance.new("BodyPosition") -- Save the X and Z position of the character local characterPositionX = character.HumanoidRootPart.Position.X local characterPositionZ = character.HumanoidRootPart.Position.Z -- Use the X and Z positions to set the position of the BodyPosition b.position = Vector3.new(characterPositionX, 500, characterPositionZ) b.maxForce = Vector3.new(500000000, 500000000, 500000000) -- changed Torso to HumanoidRootPart for compatability with R15 b.Parent = character.HumanoidRootPart wait(3) b.Parent = nil end