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: SHOP GUI HELP

Previous Thread :: Next Thread 
Calagon is not online. Calagon
Joined: 06 Oct 2012
Total Posts: 17
03 Jan 2013 09:30 AM
I made a shop GUI. It shows up really well and it is perfect, apart from one major thing.

It wont let you actually BUY the weapon, it says you need 10 Kills, and when you get 10 kills, it wont let you.

Here is the script for the desert eagle :


local player = script.Parent.Parent.Parent.Parent.Parent
local price = 10
local tool = game.Lighting:findFirstChild("Desert Eagle")

function picture()
script.Parent.Parent.Picture.Image = "http://www.roblox.com/asset/?id=54706123"
script.Parent.Parent.Price.Text = "10 Kills"
end

function buy()
wait(0.1)
local money = player.leaderstats.Kills
if money.Value >= price then
local a = tool:clone()
a.Parent = player.Backpack
else
end
end




script.Parent.MouseButton1Down:connect(buy)
script.Parent.MouseEnter:connect(picture)




So please could someone read this script and give me reasons why it doesnt work?

Thanks guys
Report Abuse
Z007 is not online. Z007
Joined: 14 Sep 2010
Total Posts: 11729
03 Jan 2013 09:43 AM
Try Leaderstats instead of leaderstats. :/
Report Abuse
Z007 is not online. Z007
Joined: 14 Sep 2010
Total Posts: 11729
03 Jan 2013 09:48 AM
My last post won't work, this should!!
local player = script.Parent.Parent.Parent.Parent.Parent
local price = 10
local tool = game.Lighting:findFirstChild("Desert Eagle")

function picture()
script.Parent.Parent.Picture.Image = "http://www.roblox.com/asset/?id=54706123"
script.Parent.Parent.Price.Text = "10 Kills"
end

function buy()
wait(0.1)
local money = player.leaderstats.KOs.Value
if money.Value >= price then
local a = tool:clone()
a.Parent = player.Backpack
else
end
end




script.Parent.MouseButton1Down:connect(buy)
script.Parent.MouseEnter:connect(picture)


If your leaderboard says "Kills" instead of "KOs" then change the "KOs" to "Kills"
Report Abuse
GiverLol is not online. GiverLol
Joined: 20 Dec 2010
Total Posts: 810
03 Jan 2013 09:54 AM
Use instead of "player.leaderstats.Kills"
"player.leaderstats.Kills.Value"

The post above could also help >.>
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