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: My Jetpack broke when I Fixed a Bug

Previous Thread :: Next Thread 
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
26 Aug 2012 01:45 PM
I didn't exactly fix the bug, but I made a new one! Yay me! I do it all the time! I put this code in a LocalScript for my jetpack:

--Made by Dozer86421
local Tool = script.Parent
local EngineActive = false

Tool.Equipped:connect(function(mouse)
local User = Tool.Parent
mouse.Button1Down:connect(function()
EngineActive = true
BG = Instance.new("BodyGyro", User.Torso)
BV = Instance.new("BodyVelocity", User.Torso)
BV.velocity = Vector3.new(0,0,0)
while EngineActive and wait() do
BG.cframe = CFrame.new(User.Torso.Position,mouse.Hit.p)
BV.velocity = BG.cframe.lookVector * 500
mouse.Button1Up:connect(function()
EngineActive = false
BV.velocity = Vector3.new(0,0,0)
end
end)
end)
end)

Tool.Unequipped:connect(function()
EngineActive = false
BG:Destroy()
BV:Destroy()
end)

It's in a Tool, and when I added this code:

mouse.Button1Up:connect(function()
EngineActive = false
BV.velocity = Vector3.new(0,0,0)

I also added an end), to close up that code. Can anyone figure out what the heck happened? I addd just a little bit of code, and the next thing I know, it breaks! If you need more information to figure this out, just tell me.
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
26 Aug 2012 01:45 PM
Added*
Report Abuse
TimeworksX is not online. TimeworksX
Joined: 14 Feb 2011
Total Posts: 421
26 Aug 2012 01:47 PM
output?
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
26 Aug 2012 01:48 PM
Nope, no Output...
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
26 Aug 2012 01:52 PM
WAIT- I got some Output!

13:50:52 - Players.Dozer86421.Backpack.JetPack.FlyScript:19: ')' expected (to close '(' at line 15) near 'end'

Heh what the heck the heck is it talking about?
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
26 Aug 2012 02:01 PM
You forgot a ).
Report Abuse
Stealthah is not online. Stealthah
Joined: 18 Aug 2012
Total Posts: 288
26 Aug 2012 02:03 PM
Yeah, you forgot a ) a the first bit
Report Abuse
TimeworksX is not online. TimeworksX
Joined: 14 Feb 2011
Total Posts: 421
26 Aug 2012 02:08 PM
--Made by Dozer86421
local Tool = script.Parent
local EngineActive = false

Tool.Equipped:connect(function(mouse)
local User = Tool.Parent
mouse.Button1Down:connect(function()
EngineActive = true
BG = Instance.new("BodyGyro", User.Torso)
BV = Instance.new("BodyVelocity", User.Torso)
BV.velocity = Vector3.new(0,0,0)
while EngineActive and wait() do
BG.cframe = CFrame.new(User.Torso.Position,mouse.Hit.p)
BV.velocity = BG.cframe.lookVector * 500
mouse.Button1Up:connect(function()
EngineActive = false
BV.velocity = Vector3.new(0,0,0)
end)
end)
end)
end)

Tool.Unequipped:connect(function()
EngineActive = false
BG:Destroy()
BV:Destroy()
Report Abuse
TimeworksX is not online. TimeworksX
Joined: 14 Feb 2011
Total Posts: 421
26 Aug 2012 02:08 PM
--Made by Dozer86421
local Tool = script.Parent
local EngineActive = false

Tool.Equipped:connect(function(mouse)
local User = Tool.Parent
mouse.Button1Down:connect(function()
EngineActive = true
BG = Instance.new("BodyGyro", User.Torso)
BV = Instance.new("BodyVelocity", User.Torso)
BV.velocity = Vector3.new(0,0,0)
while EngineActive and wait() do
BG.cframe = CFrame.new(User.Torso.Position,mouse.Hit.p)
BV.velocity = BG.cframe.lookVector * 500
mouse.Button1Up:connect(function()
EngineActive = false
BV.velocity = Vector3.new(0,0,0)
end)
end)
end)
end)

Tool.Unequipped:connect(function()
EngineActive = false
BG:Destroy()
BV:Destroy()
Report Abuse
TimeworksX is not online. TimeworksX
Joined: 14 Feb 2011
Total Posts: 421
26 Aug 2012 02:09 PM
--Made by Dozer86421
local Tool = script.Parent
local EngineActive = false

Tool.Equipped:connect(function(mouse)
local User = Tool.Parent
mouse.Button1Down:connect(function()
EngineActive = true
BG = Instance.new("BodyGyro", User.Torso)
BV = Instance.new("BodyVelocity", User.Torso)
BV.velocity = Vector3.new(0,0,0)
while EngineActive and wait() do
BG.cframe = CFrame.new(User.Torso.Position,mouse.Hit.p)
BV.velocity = BG.cframe.lookVector * 500
mouse.Button1Up:connect(function()
EngineActive = false
BV.velocity = Vector3.new(0,0,0)
end
end))
end)
end)

Tool.Unequipped:connect(function()
EngineActive = false
BG:Destroy()
BV:Destroy()
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