Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Pull things with a rope?

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

✓ Accepted answer

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)

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.

1 comment

0

Yeah, it's better to start with something easier before getting in tweening.

This discussion is preserved as it was. New answers, comments, and votes are closed.