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

How Do I Change The Speed Of A Part Using BodyVelocity?

Asked by 9 years ago

I'm making a jump scare for one of my horror games, and I want a model named "Deathman" as seen below, to move at a certain speed. Each part in the model has a bodyvelocity inserted into it to make it move.

This is the working script I'm using as of now, is there any way I could insert a node changing the speed of the model, or do I have to change it using the properties window?

I hope you can help, thanks!

Sound = script.Parent.Scream Ready = true function onTouch(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h ~= nil and Ready == true then Ready = false local plyr = game.Players:FindFirstChild(h.Parent.Name) local s = Sound:clone() game.Lighting.DeathMan:clone().Parent = game.Workspace s.Parent = plyr wait(2) game.Workspace.DeathMan:Remove() s:remove() wait(25) Ready = true end end

script.Parent.Touched:connect(onTouch)

1 answer

Log in to vote
0
Answered by
snow29 0
9 years ago

1.) Try using ServerStorage not Lighting :P 2.) Maybe,** I** would use BodyPosition...

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

Is a sample (for a teleport effect)

If I helped please Upvote/Like

Ad

Answer this question