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

Previous Thread :: Next Thread 
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
09 Mar 2014 06:03 PM
local Mon = game.Players.LocalPlayer.leaserstats.Money.Value

function onClick()
if Mon >= 900 then
Mon = Mon - 900
game.Lighting["PowerShot"]:Clone().Parent = game.Players.LocalPlayer.Backpack
game.Lighting["PowerShot"]:Clone().Parent = game.Players.LocalPlayer.StarterGear
end
end
script.Parent.MouseButton1Down:connect(onClick)

--This is inside of a TextButton, if the player has over 900 money, it still doesn't work.
--Help?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
09 Mar 2014 06:05 PM
local Mon = game.Players.LocalPlayer.leaserstats.Money

function onClick()
if Mon.Value >= 900 then
Mon.Value = Mon.Value - 900
game.Lighting["PowerShot"]:Clone().Parent = game.Players.LocalPlayer.Backpack
game.Lighting["PowerShot"]:Clone().Parent = game.Players.LocalPlayer.StarterGear
end
end
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
09 Mar 2014 06:11 PM
Still doesn't work.

Is it something wrong with how it's set up maybe?

ScreenGui
>Frame
>>TextLabel
>TextButton
>Frame
>>TextLabel
>>TextButton
>>>LocalScript
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
09 Mar 2014 06:12 PM
leaserstats?

Just noticed, might be typo.
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
09 Mar 2014 06:20 PM
Thanks, fixed that.

This still doesn't work though:

local Mon = game.Players.LocalPlayer.leaderstats.Money

function onClick()
if Mon.Value >= 900 then
Mon.Value = Mon.Value - 900
game.Lighting"PowerShot":Clone().Parent = game.Players.LocalPlayer.Backpack
game.Lighting"PowerShot":Clone().Parent = game.Players.LocalPlayer.StarterGear
end
end
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
09 Mar 2014 06:24 PM
local plr = game.Players.LocalPlayer
Mon = plr.leaderstats.Money

--Sometimes calling everything in one go causes problems. Anyway you can't do much without output. Test in play solo.

function onClick()
if Mon.Value >= 900 then
Mon.Value = Mon.Value - 900
game.Lighting["PowerShot"]:Clone().Parent = plr.Backpack
game.Lighting["PowerShot"]:Clone().Parent = plr.StarterGear
end
end
script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
09 Mar 2014 06:31 PM
Thanks, it worked!
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