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 » Scripters
Home Search
 

Re: Help with leaderboard

Previous Thread :: Next Thread 
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
17 Jul 2016 07:45 AM
Ok, so say I have a money column on my leaderboard. What I need in my game is a door that opens upon touching it, but only if you have enough money. On top of that, It should not take away your money. If I have my cash column and door set up (door has no scripts) What kind of stuff should I add to make this possible?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Jul 2016 07:56 AM
local debounce = false

door.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local stats = player:WaitForChild('leaderstats')
local money = stats.Money
if money.Value >= 250 and not debounce then
debounce = true
door.Transparency = 0.5
door.CanCollide = false
money.Value = money.Value - 250
wait(1)
debounce = false
end
end
end)


Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
17 Jul 2016 03:40 PM
Ah ok. Thanks for that!
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
19 Jul 2016 04:13 AM
Actually I did just remember something. What is the lind pf code that searches for the correct money amount?
Report Abuse
sentry3 is not online. sentry3
Joined: 01 May 2010
Total Posts: 538
19 Jul 2016 09:16 AM
'if money.Value >= 250' the number is the moneyamount
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
19 Jul 2016 05:11 PM
Ok thanks a bunch!
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
20 Jul 2016 05:34 AM
The script timeticks gave me, does it deduct the smount of money after unlocking he door? I believe it does, but Id just like clzrification
Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
20 Jul 2016 05:37 AM
Yes it does,

"money.Value = money.Value - 250"

Remove that line if you don't want it to remove your money.
Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
20 Jul 2016 05:38 AM
subtract your money**
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
20 Jul 2016 07:41 AM
Ok yes. That was what I thought. Knowing code, I didn't quite know if that was it or not.
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
20 Jul 2016 07:41 AM
Also, sorry to double post, but how would one edit the script to make a brick dissapear upon touch if you had enough money?
Report Abuse
fluffyrox4 is not online. fluffyrox4
Joined: 11 Apr 2015
Total Posts: 70
21 Jul 2016 06:42 AM
Ok sorry! But dies this script a one payment, never pay to unlock again?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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