|
| 09 Oct 2011 07:09 PM |
function onKeyDown(key) key:lower() if key == "k" then local char = script.Parent.Parent.Parent.Character.Head local bomb = Instance.new("Part") bomb.Anchored = false bomb.CanCollide = true bomb.BrickColor = BrickColor.new("Really black") bomb.Shape = 0 bomb.Size = Vector3.new(3,3,3) bomb.Position = (char * 30) bomb.Parent = game.Workspace wait(2) bomb.BrickColor = BrckColor.new("White") wait(1) bomb.Reflectance = 9 wait(1) bomb.Reflectance = 0 wait(1) bomb.Reflectance = 9 wait(1) bomb.Reflectance = 0 wait(3) local BomberStomper = Instance.new("Explosion") BomberStomper.BlastPressure = 900 BomberStomper.BlastRadiuse = 20 BomberStomper.Parent = bomb reload(45)
end end
function onSelected(mouse) mouse.KeyDown:connect(onKeyDown) end
script.Parent.Selected:connect(onSelected)
output
Players.joshrocks101.Backpack.HopperBin.kFunctionScript:11: attempt to perform arithmetic on local 'char' (a userdata value)
|
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:10 PM |
key:lower()
Should be
local key = key:lower()
-I love music. I play guitar. -I enjoy foruming. -I know multiple programming languages, along with mark-up languages. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:13 PM |
| I tried that but i still get the same output.Whats wrong with line 11? |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:15 PM |
bomb.Position = (char * 30)
Position is a Vector3
-I love music. I play guitar. -I enjoy foruming. -I know multiple programming languages, along with mark-up languages. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:17 PM |
bomb.Position = (char * 30) You're trying to multiply heads? MADDD SSCCCIIIEENNNNCCCEEE! bomb.Position = (char.Postion * Vector3.new(30, 30, 30)) -- I'm assuming this is what you want? -I think I'm addicted to stopping and staring at pictures.- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:17 PM |
So would i put?
bomb.Position = Vector3.new(char * 30)
|
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:20 PM |
@josh It depends, do you want the X, Y, or Z axis to be changed?
-I think I'm addicted to stopping and staring at pictures.- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:20 PM |
@hailey It worked.But now my output says
Postion is not a valid member of Part Sun Oct 09 20:19:24 2011 - Script "Players.joshrocks101.Backpack.HopperBin.kFunctionScript", Line 11 Sun Oct 09 20:19:24 2011 - stack end Sun Oct 09 20:19:24 2011 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:21 PM |
You spelled Position wrong, lol.
-Like an __AWESOME__ boss |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:22 PM |
| ElectricBlase Was right now it works,Thanks all you peoples. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:22 PM |
@josh I don't know why it would say that, it usually says that when you're trying to use Position on a model
-I think I'm addicted to stopping and staring at pictures.- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:23 PM |
lolololo hailey failed lolo
@Josh - No problem. ;]
-Like an __AWESOME__ boss |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:25 PM |
| XD Now i get to work on the sKeyFunction,I wonder what i'll make it? :D |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 07:26 PM |
lolo I failed
-I think I'm addicted to stopping and staring at pictures.- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 08:14 PM |
| Oh sorry i forgot 1 more question were exactly would i put a wait time in this before you can press the key and it work again? |
|
|
| Report Abuse |
|
|