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

Tool arm fix?

Asked by
Mystdar 352 Moderation Voter
10 years ago

I have the script before it, but that bit works fine. If need be I can post it here. I have scripted the position of an arm on a tool:

wait (1)
while wait do
for i=1, 5 do
weld1.C1 = CFrame.new(0.3, 0.05, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-26), 0, math.rad(0)) -- this bit is supposed to add that amount 5 times, but instead it just makes it that angle that five times
end 
end

In the end it is supposed to be :

weld1.C1 = CFrame.new(1.5, 0.3, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-105), 0, math.rad(0)) -- Left

Any help? Thanks.

2 answers

Log in to vote
1
Answered by 10 years ago

Multiply -26 by i like this:

math.rad((-26) * i)
Ad
Log in to vote
0
Answered by
iaz3 190
10 years ago

I believe the issue is you are not adding to the C1 CFrame, but setting it to the same value 5 times.

you will have to factor in the current weld1.C1 into that

something like

weld1.C1 = weld1.C1 + CFrame.new(0.3, 0.05, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-26), 0, math.rad(0))

That may work, or you may need to adjust it, i don't have time to test. Maybe the * operator would be better.

Answer this question