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: Could someone debug this script for me?

Previous Thread :: Next Thread 
Danert1 is not online. Danert1
Joined: 06 Jun 2010
Total Posts: 1550
03 Apr 2013 05:40 PM
I am making a script for a swivel gun/cannon. When the button is clicked, I want a black square to fire out. Can someone debug this?

function onClicked()
Instance.new("Smoke", workspace.SwivelTip)
Workspace.SwivelTip.Smoke.Opacity = 0.3
Workspace.SwivelTip.Smoke.RiseVelocity = 0.01
Workspace.SwivelTip.Smoke.Size = 0.1
Workspace.Swivel.Sound:Play()
Instance.new("Part", workspace.Swivel)
Workspace.Swivel.Part = Ball
Ball.FormFactor = Custom
Ball.Size = 0, 0, 0
Ball.BrickColor = BrickColor.Black()
Instance.new("BodyVelocity", workspace.Swivel.Part)
Ball.BodyVelocity = 100, 0, 0
wait(2)
Workspace.SwivelTip.Smoke.Opacity = 0
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Thanks for any help,
-Danert1
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 05:41 PM
Output?!?!?!?
Report Abuse
Flash77 is not online. Flash77
Joined: 14 Jun 2008
Total Posts: 550
03 Apr 2013 05:42 PM
Workspace.Swivel.Part = Ball

change to:

Ball = Workspace.Swivel.Part
Report Abuse
Danert1 is not online. Danert1
Joined: 06 Jun 2010
Total Posts: 1550
03 Apr 2013 05:42 PM
Output;
17:42:39.759 - Part is not a valid member of Part
17:42:39.759 - Script "Workspace.Part.Script", Line 8
17:42:39.759 - stack end
17:42:39.759 - Disconnected event because of exception
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 05:44 PM
That means that there is not Part named "Part" in swivel
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 05:45 PM
no Part*
Report Abuse
Danert1 is not online. Danert1
Joined: 06 Jun 2010
Total Posts: 1550
03 Apr 2013 05:46 PM
Output updated after using flash's code:

17:46:05.087 - Script "Workspace.Part.Script", Line 9
17:46:05.087 - stack end
17:46:05.087 - Disconnected event because of exception

Still doesn't work :C
Report Abuse
Flash77 is not online. Flash77
Joined: 14 Jun 2008
Total Posts: 550
03 Apr 2013 05:47 PM
Custom should be a string
"Custom"
Report Abuse
Flash77 is not online. Flash77
Joined: 14 Jun 2008
Total Posts: 550
03 Apr 2013 05:48 PM
Ball.Size = 0, 0, 0 should use Vector3
Ball.Size = Vector3.new(0, 0, 0)

silly floodcheck...
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 05:49 PM
function onClicked()
Instance.new("Smoke", workspace.SwivelTip)
Workspace.SwivelTip.Smoke.Opacity = 0.3
Workspace.SwivelTip.Smoke.RiseVelocity = 0.01
Workspace.SwivelTip.Smoke.Size = 0.1
Workspace.Swivel.Sound:Play()
Instance.new("Part", workspace.Swivel)
local Ball = Workspace.Swivel.Part
Ball.FormFactor = "Custom"
Ball.Size = Vector3.new(0, 0, 0)
Ball.BrickColor = BrickColor.Black()
local BV = Instance.new("BodyVelocity", workspace.Swivel.Part)
BV.velocity = Vector3.new(100, 0, 0)
wait(2)
Workspace.SwivelTip.Smoke.Opacity = 0
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
Flash77 is not online. Flash77
Joined: 14 Jun 2008
Total Posts: 550
03 Apr 2013 05:49 PM
Ball.BodyVelocity = 100, 0, 0
should be
Ball.BodyVelocity = Vector3.new(100, 0, 0)

i should of just combines all of these posts... that way evil flood check couldnt of stopped me.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 05:50 PM
you have to set the velocity property of the Bodyvelocity...
Report Abuse
Danert1 is not online. Danert1
Joined: 06 Jun 2010
Total Posts: 1550
03 Apr 2013 05:55 PM
Put your script in not, put in my own line (the position)
Now it won't fire when clicked.


function onClicked()
Instance.new("Smoke", workspace.SwivelTip)
Workspace.SwivelTip.Smoke.Opacity = 0.3
Workspace.SwivelTip.Smoke.RiseVelocity = 0.01
Workspace.SwivelTip.Smoke.Size = 0.1
Workspace.Swivel.Sound:Play()
Instance.new("Part", workspace.Swivel)
Ball = Workspace.Swivel.Part
Ball.FormFactor = Custom
Ball.Size = 0.2, 0.2, 0.2
Ball.BrickColor = BrickColor.Black()
Ball.Position = (-595.69, 3.931, -50.5)
Instance.new("BodyVelocity", workspace.Swivel.Part)
Ball.BodyVelocity = 100, 0, 0
wait(2)
Workspace.SwivelTip.Smoke.Opacity = 0
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Help? :s
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Apr 2013 06:16 PM
Use the flipping output...
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