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: Whats wrong with this?

Previous Thread :: Next Thread 
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
09 Oct 2011 07:13 PM
I tried that but i still get the same output.Whats wrong with line 11?
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
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
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
09 Oct 2011 07:17 PM
So would i put?


bomb.Position = Vector3.new(char * 30)
Report Abuse
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
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
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Oct 2011 07:21 PM
You spelled Position wrong, lol.


-Like an __AWESOME__ boss
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
09 Oct 2011 07:22 PM
ElectricBlase Was right now it works,Thanks all you peoples.
Report Abuse
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Oct 2011 07:23 PM
lolololo hailey failed lolo

@Josh - No problem. ;]


-Like an __AWESOME__ boss
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
09 Oct 2011 07:26 PM
lolo I failed

-I think I'm addicted to stopping and staring at pictures.-
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
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
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