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: Gui buy button not working

Previous Thread :: Next Thread 
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
29 Nov 2013 02:44 AM
cash = game.Players.LocalPlayer.leaderstats.Cash

function buy()

if script.Parent.Parent.Parent.Mower.Value == 1 then
if cash.Value >= 100 then
local mower = game.Lighting.Mowers["1AllAroundMowers"]:Clone()
mower.Name = "All Around Mower"
mower.Parent = game.Players.LocalPlayer.Backpack
print("Bought a mower!")
end
end


end

script.Parent.MouseButton1Click:connect(buy)


This doesn't seem to be working. Its a local script, and is not providing any output at all. Im a bit confused.
Report Abuse
Cizox is not online. Cizox
Joined: 25 Dec 2009
Total Posts: 42220
29 Nov 2013 02:47 AM
Note that when testing solo, leaderstats and all those types of values wont load because the player loads before the scripts load.
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
29 Nov 2013 02:50 AM
Yeah, I launch the Server and Client, not Solo
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 02:51 AM
Where is this LocalScript placed.....?
Report Abuse
whyaname98 is not online. whyaname98
Joined: 22 May 2011
Total Posts: 3979
29 Nov 2013 02:57 AM
cash = game.Players.LocalPlayer.leaderstats.Cash
must be
cash = game.Players.LocalPlayer.leaderstats.Cash.Value

#LogicMakesSense
Report Abuse
im2awsm is not online. im2awsm
Joined: 25 Aug 2010
Total Posts: 2295
29 Nov 2013 03:12 AM
The local script is in a gui. All other scripts in the gui are local scripts and they work perfectly
Report Abuse
6e8 is not online. 6e8
Joined: 21 Jul 2013
Total Posts: 10
29 Nov 2013 03:22 AM
@Why, that won't work. That makes it only readable, not able to write to the value.
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