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

So my script throws me into the ground and I want it to throw me somewhere else?

Asked by 6 years ago

My script:

function onTouched(hit)
    wait()
    local character = hit.Parent
    if character and character:findFirstChild("Humanoid") then
        local pos = script.Parent.Parent.PartV
        local b = Instance.new("BodyPosition")
        b.position = Vector3.new(pos.Position)
        b.maxForce = Vector3.new(500000000, 500000000, 500000000)
        b.Parent = character.Torso
        wait(3)
        b.Parent = nil
    end
end

script.Parent.Touched:connect(onTouched)

So what it's support to do is move me to a part that's above it. But instead, it moves me to the baseplate.

Here's another script:

function keydown(c, gameProcessedEvent)
    if c.KeyCode == Enum.KeyCode.Q then
        local ab = game.ReplicatedStorage.a
        local abClone = ab:Clone()
        abClone.Parent = game.Workspace
        local bodypos = script.Parent.Parent.Character.HumanoidRootPart.Position
        abClone:MoveTo(Vector3.new(bodypos))

    end
end

game:GetService("UserInputService").InputBegan:connect(keydown)

In here, if I press Q, it copies the model and goes to my humanoidrootpart's position but when i walk around, it teleport in the same spot where it last tp'd.

Answer this question