|
| 08 Feb 2012 01:14 PM |
This is part of a script in my tool, and it does the position and rotation modifying. The problem is that when you turn a brick a few times it gets out of whack and starts turning randomly instead of according to x (which is a number between 0.5 and 5, at an increment of 0.5) If there are any other methods or a fix for this please post them here. Thanks
function cframe(part, x, tag, tab) local xRot, yRot, zRot = part.CFrame:toEulerAnglesXYZ() if tag == tab[1] then part.CFrame = part.CFrame + Vector3.new(x, 0, 0) elseif tag == tab[2] then part.CFrame = part.CFrame + Vector3.new(0, x, 0) elseif tag == tab[3] then part.CFrame = part.CFrame + Vector3.new(0, 0, x) elseif tag == tab[4] then part.CFrame = part.CFrame * CFrame.Angles(0, -yRot, -zRot) wait(1) part.CFrame = part.CFrame * CFrame.Angles(math.rad(x * 30), 0, 0) wait(1) part.CFrame = part.CFrame * CFrame.Angles(0, yRot, zRot) elseif tag == tab[5] then part.CFrame = part.CFrame * CFrame.Angles(-xRot, 0, -zRot) wait(1) part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(x * 30), 0) wait(1) part.CFrame = part.CFrame * CFrame.Angles(-xRot, 0, zRot) elseif tag == tab[6] then part.CFrame = part.CFrame * CFrame.Angles(-xRot, -yRot, 0) wait(1) part.CFrame = part.CFrame * CFrame.Angles(0, 0, math.rad(x * 30)) wait(1) part.CFrame = part.CFrame * CFrame.Angles(xRot, yRot, 0) end end |
|
|
| Report Abuse |
|