generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: What's wrong with this script?

Previous Thread :: Next Thread 
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
19 Oct 2013 10:14 PM
Can anyone find out the problem?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
19 Oct 2013 10:36 PM
Is there anyone?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
19 Oct 2013 11:10 PM
No one? D:
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
20 Oct 2013 04:52 AM
Can anyone please? D:
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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 is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image