|
| 19 Oct 2013 09:43 PM |
Recently after a Roblox update some of my scripts stopped working and I need to correct one important script. Because the output was not working I couldn't determine the correct line but I tried to find the part where the error was occurring:
function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end
function move(point, engine) local origincframe = engine:findFirstChild("BodyGyro").cframe size = engine.Size
target = engine.Position+((point - engine.Position).unit*100) local dir = (target - engine.Position).unit local spawnPos = engine.Position left = engine.CFrame*CFrame.new(-size.x/2, 0, 0).p right = engine.CFrame*CFrame.new(size.x/2, 0, 0).p md = (target - engine.Position).magnitude
foebmd = engine.CFrame*CFrame.new(0, 0, -md).p toleft = (target -left).magnitude toright = (target -right).magnitude rot = ((foebmd - target).magnitude/10) local pos = spawnPos + (dir * 1) engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000, 9000, 9000) if toleft< toright and toleft >rot then engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)*CFrame.fromAxisAngle( Vector3.new(0, 0, rot) , math.pi/ 30 ) elseif toleft > toright and toright >rot then engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)*CFrame.fromAxisAngle( Vector3.new(0, 0,-rot) , math.pi/ 30 ) else engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir) end wait(0.1) engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(0, 0, 0) engine:findFirstChild("BodyGyro").cframe = origincframe end
function findPlane(player) local list = player.Character:GetChildren() for x = 1, #list do if (list[x].Name == "Plane") then local weld = list[x]:FindFirstChild("Parts"):FindFirstChild("Seat"):FindFirstChild("SeatWeld") if (weld ~= nil) and (weld.Part1 == player.Character:FindFirstChild("Torso")) then return list[x] end end end return nil end
function onButton1Down(mouse) local vehicle = findPlane(script.Parent.Parent.Parent) if vehicle ~= nil and debounce == false and planedebounce == false then plane = vehicle.Parts debounce = true
controlling = true
while true do wait() local engine = vehicle.Parts.Engine local position = mouse.Hit local target = position.p if engine:findFirstChild("Blank") == nil then move(target, engine) end if planedebounce == true or controlling == false then break end end wait(.1) debounce = false end end
function onButton1Up(mouse) controlling = false end |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 10:14 PM |
| Can anyone find out the problem? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 20 Oct 2013 05:01 AM |
| Without defining what doesn't work nobody will read that.. When a script is that long just post it on pastebin.. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 05:43 AM |
| Aww man, I've been hoping for so long to get this fixed up, oh well. :c |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 20 Oct 2013 06:22 AM |
we won't fix free model scripts (Mark901's Aircraft Seat) for you.
go away. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 06:40 AM |
| This is actually a rocket script... It is only a part of the script out of the many lines that are other controls like the explosion, controls and some other stuff. Two parts that may be the problem are the controls or this part of the script I posted. And about the parts, they are supposed to clone other scripts like the one that gives power to the Engine so that the rocket can fly. So they may be the cause too... |
|
|
| Report Abuse |
|
|