|
| 04 Nov 2011 04:55 PM |
Everytime i try a hopperbin script it won't work and it won't give me a output -_-" so can someone please help is there annything wrong with this??
function onKeyDown(key) key:lower() if key == "f" then local char = script.Parent.Parent.Parent.Character local blast = Instance.new("Part") blast.BrickColor = BrickColor.new("Medium stone grey") blast.CanCollide = false blast.Shape = 1 blast.Name = Blast blast.Size = Vector3.new(1,1,1) blast.Parent = game.Workspace local bingl = Instance.new("BodyForce") bingl.force = Vector3.new(0,100,0) bingl.Parent = blast local c = blast c.Position = (char.Torso.Position + vector3.new(0.1,0.1,0.1)) blast.Velocity = (c * 40) bingl.Parent = blast local j = script.Parent.feffects local g = j:copy() g.Parent = blast.Parent end end function onSelected(mouse) mouse.KeyDown:connect(onKeyDown) end |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 04 Nov 2011 04:57 PM |
Your onSelected(mouse) function is never executed. I'm assuming you want to connect it to an event?
~Flurite - ROBLOX Wiki Writer |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:06 PM |
| Oh thankyou i didn't even notice lol i made a couple errors but there easy to fix so see ya. and thanks again. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:10 PM |
Oh wait i did run into a problem i fixd everything except line 17 heres the output.
Players.joshrocks101.Backpack.HopperBin.fFunction:17: attempt to perform arithmetic on local 'c' (a userdata value)
|
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:14 PM |
You're attempting to multiply an object by 40 (and obviously that's impossible) :P
c.Position = (char.Torso.Position + vector3.new(0.1,0.1,0.1)) blast.Velocity = (c * 40)
If what you meant to do is multiply c's position by 40 well then do so :3 |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:16 PM |
| So it's not possible to multiply the bricks velocity by the bricks position so it will fly strait instead of all over the place? |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 04 Nov 2011 05:18 PM |
No, I think all he has to do is capitalize the 'v' in vector3.
~Flurite - ROBLOX Wiki Writer |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:22 PM |
| no i spelled it with a capital v cause it errored but it still won't times it.......Is there anny possible way to do this? |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 04 Nov 2011 05:25 PM |
Oh, sorry, I didn't read the whole thing.
According to your script, 'c' is an object. You want to access it's position and multiply it by 40, right? So on that line it should be: (c.Position * 40).
I think..
~Flurite - ROBLOX Wiki Writer |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:27 PM |
Yeah i just now figured that out when i fixed it now it shoots strait up is there a reason for this if so can i have a few tips on how to fix this? I need it to shoot strait
|
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:33 PM |
| i used a lower velocity and now it bounces it won't go strait this is so annoying can someone help? is there somnething like bodygyro or something i could insert into it and make it go strait? |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:35 PM |
^^^ That's what I said o.o *notices main group is wiki writer* LOOOOOOOL ==================== Straight what? Up, down, left, right, forward, backward? |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:37 PM |
| it needs to go forward oif were it spawns thats what iu ment. |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:40 PM |
blast.Velocity = (c.CFrame.lookVector * 40)
is what you're looking for. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:41 PM |
script.Parent.Selected:connect(function(mouse) mouse.KeyDown:connect(function(key) key:lower() if key == "f" then local char = script.Parent.Parent.Parent.Character local blast = Instance.new("Part") blast.BrickColor = BrickColor.new("Medium stone grey") blast.CanCollide = false blast.Shape = 1 blast.Name = Blast blast.Size = Vector3.new(1,1,1) blast.Parent = game.Workspace local bingl = Instance.new("BodyForce") bingl.force = Vector3.new(0,100,0) bingl.Parent = blast local c = blast c.Position = (char.Torso.Position + Vector3.new(0.1,0.1,0.1)) blast.Velocity = (c * 40) bingl.Parent = blast local j = script.Parent.feffects local g = j:copy() g.Parent = blast.Parent end end) end) |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:41 PM |
| lol now it shoots behind me. |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:42 PM |
| blast.Velocity = (c.CFrame.lookVector * -40) |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:42 PM |
script.Parent.Selected:connect(function(mouse) mouse.KeyDown:connect(function(key) key:lower() if key == "f" then local char = script.Parent.Parent.Parent.Character local blast = Instance.new("Part") blast.BrickColor = BrickColor.new("Medium stone grey") blast.CanCollide = false blast.Shape = 1 blast.Name = Blast blast.Size = Vector3.new(1,1,1) blast.Parent = game.Workspace local bingl = Instance.new("BodyForce") bingl.force = Vector3.new(0,100,0) bingl.Parent = blast local c = blast c.Position = (char.Torso.Position + Vector3.new(0.1,0.1,0.1)) blast.Velocity = (c.CFrame.lookVector * -40) bingl.Parent = blast local j = script.Parent.feffects local g = j:copy() g.Parent = blast.Parent end end) end) |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 04 Nov 2011 05:42 PM |
Why are you laughing? That's not really what you said..
~Flurite - ROBLOX Wiki Writer |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:43 PM |
| Flur what are you talking about? |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:43 PM |
| So is this supposed to work werrever i look does it glitch when in in studio mode? |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:45 PM |
It should work in any direction.
However I think there's a bug that makes it weigh more and need more force when you're actually in-game. Not sure. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 04 Nov 2011 05:46 PM |
I was talking to GigsD46 quite a few posts ago, because he was laughing at me?
~Flurite - ROBLOX Wiki Writer |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 05:48 PM |
^ I wasn't laughing at you silly :3 (btw that last character is X :p)
So anyway Josh, is your problem solved? |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2011 05:53 PM |
| Well in studio it only shoots a ceirtan direction but in play mode it might work. :D i hope so. |
|
|
| Report Abuse |
|
|