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
 

Why isnt this working?

Previous Thread :: Next Thread 
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 08:09 PM
Hi, ive got this bit of script and its in a tool. It is supposed to "craft" items into something new when you equip the tool, but, i cant seem to get that working. Here it is:

function equipped(mouse)

local Obj1 = Player.Backpack:findFirstChild("Megaphone")
local Obj2 = Player.Backpack:findFirstChild("Gunpowder")
local Obj3 = Player.Backpack:findFirstChild("Pile of Plasma")

if Obj1 ~= nil and Obj2 ~= nil and if Obj3 ~= nil then
Obj1:remove()
Obj2:remove()
Obj3:remove()
game.Lighting.PlasmaPistol:clone().Parent = Player.Backpack
end
end)


Hope someone can help! Thanks!


Report Abuse
ap1ratesl1fe is not online. ap1ratesl1fe
Joined: 17 Nov 2008
Total Posts: 368
15 Nov 2011 08:18 PM
Need to connect the function.

script.Parent.Equipped:connect(equipped)
Report Abuse
techepicface is not online. techepicface
Joined: 28 Jun 2011
Total Posts: 1180
15 Nov 2011 08:32 PM
and you'll need to remove the ")" after "end", and remove the extra "if" before obj3 ~= nil
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 08:43 PM
If i need to add that to the very bottom of the script, its not working.
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 08:46 PM
techepic, i also tried doing that, its still not working :P
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
15 Nov 2011 08:50 PM
Is Player defined?
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 09:11 PM
Oooh.. i just noticed that. I really dont know how to define it. Like script.Parent.Player or something? :/
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 09:48 PM
Bump?
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
15 Nov 2011 10:41 PM
How do i define "Player"?
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