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
|
  |
| Joined: 14 Sep 2010 |
| Total Posts: 11729 |
|
|
| 03 Jan 2013 09:43 AM |
| Try Leaderstats instead of leaderstats. :/ |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|