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: Can anyone tell me what is wrong here?

Previous Thread :: Next Thread 
turkeyvulture is not online. turkeyvulture
Joined: 11 Aug 2008
Total Posts: 4825
04 Feb 2013 10:18 PM
It's a gui shop button script, supposed to give you a gun for 100 OSC. I made sure the parenting was right, but when I click the button no credits are taken and no gun is given. Can anyone figure out what is wrong?

player = script.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.OSC
price = 100
tool = game.Lighting:findFirstChild("Addesso Rifle")


function buy()
if money.Value >= price then
money.Value = money.Value - price
local a = tool:clone()
a.Parent = player.Backpack
local b = tool:clone()
b.Parent = player.StarterGear

end
end
script.Parent.MouseButton1Down:connect(buy)
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
05 Feb 2013 04:07 AM
It's probably the amount of parents you have to get to the player. Maybe to little, or too much.
BTW, you can use 1 line to clone the tool:

tool:clone().Parent = player.Backpack
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