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

Pull things with a rope?

Asked by 5 years ago

im trying to make a block get pulled with a rope i got the script test script but works for what i need it to do

local Rope = script.Parent.RopeConstraint
local green = script.Parent.Parent.Green
local Red = script.Parent.Parent.Red
local Blue = script.Parent.Parent.Blue


Blue.ClickDetector.MouseClick:Connect(function()
    Rope.Length = 2.526
end)

green.ClickDetector.MouseClick:Connect(function()
    Rope.Length = 31.521
end)

so it starts at 31.521 then when blue button gets pushed it makes the langth of the rope 2.526 but the only problem is when it does its almost instint is there a way to slow it down to see it move?

2 answers

Log in to vote
0
Answered by
Axdrei 107
5 years ago

Hello over! Have you tried to use for i loop ? That's what you're looking for! Let me give you an example.

local Rope = script.Parent.RopeConstraint
local Green = script.Parent.Parent.Green
local Red = script.Parent.Parent.Red
local Blue = script.Parent.Parent.Blue


Blue.ClickDetector.MouseClick:Connect(function()
    for i = 1, 4 do
        Rope.Length = Rope.Length + 0.5
        wait()
    end
end)

Green.ClickDetector.MouseClick:Connect(function()
    for i = 1, 6 do
        Rope.Length = Rope.Length + 0.5
        wait()
    end
end)
Ad
Log in to vote
0
Answered by 5 years ago

You could Tween the Rope Constraint or Make a Loop sort of the like person above said.

It's up to if you want it to look more better, Tweening is more better, but much harder. I suggest aboves explanation.

0
Yeah, it's better to start with something easier before getting in tweening. Axdrei 107 — 5y

Answer this question