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: Script for Brick to give money not working?

Previous Thread :: Next Thread 
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 04:16 PM
The Script I am using is

moneyToGive = 100
debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == true then return end
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player == nil then return end
stat = player:findFirstChild("leaderstats")
if stat == nil then return end
cash = stat:findFirstChild("Cash")
if cash == nil then return end
debounce = true
cash.Value = cash.Value + moneyToGive
wait(2)
debounce = false
end)

Also if this matters the script money leaderboard I am using i got from a free model to go with the shop gui.

Script for the money leaderboard

function Entered(player)
wait()
-- This leaderboard was made by JamiyJamie
if player:findFirstChild("leaderstats") ~= nil then
player.leaderstats:remove()
end

stats = Instance.new("IntValue")
stats.Parent = player
stats.Name = "leaderstats"

money = Instance.new("IntValue")
money.Parent = stats
money.Name = "Money"
money.Value = 250 --How much you start out with change it to how much you want
end

game.Players.PlayerAdded:connect(Entered)

c = game.Players:GetChildren()
for i=1, #c do
Entered(c[i])
end

Thanks for helping c:
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 05:23 PM
Help please?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
07 Jan 2014 05:24 PM
What do you think the problem is?
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 05:51 PM
I really should learn coding
Report Abuse
cycoboy83 is not online. cycoboy83
Joined: 31 May 2011
Total Posts: 831
07 Jan 2014 06:05 PM
You have two conflicting names. The value in the leaderboard is named "Money", while you're searching for "Cash". Change cash = stat:findFirstChild("Cash") to:

cash = stat:findFirstChild("Money")
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 06:53 PM
Still not working :c but thanks for trying and helping
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 07:10 PM
Also I think the problem is that it should be cash instead of money....... For all of them?
....i suck
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
07 Jan 2014 07:13 PM
take it slow, don't attempt big stuff if you're not certain of your skills yet.
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 07:22 PM
oh ok then... thanks? Let me put my new game on pause then :c
Report Abuse
Gkinect is not online. Gkinect
Joined: 04 Dec 2010
Total Posts: 15
07 Jan 2014 08:40 PM
You still can help c:
Report Abuse
Fir3bl4ze is not online. Fir3bl4ze
Joined: 13 Jul 2012
Total Posts: 310
07 Jan 2014 08:46 PM
Do you get an error?
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Jan 2014 08:51 PM
cash = stat:FindFirstChild("Money")


lel....
Try making your own scripts?
Report Abuse
Fir3bl4ze is not online. Fir3bl4ze
Joined: 13 Jul 2012
Total Posts: 310
07 Jan 2014 08:58 PM
We already suggested that. He said it didn't work :/
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Jan 2014 09:01 PM
if player:findFirstChild("leaderstats") ~= nil then
player.leaderstats:remove()
end

...................................
( ._.)
(._. )
( ._. )
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Jan 2014 09:02 PM
I suggest start from scratch and make our own shop.
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
07 Jan 2014 09:02 PM
>we
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
07 Jan 2014 09:03 PM
you*
our->your*
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
08 Jan 2014 04:51 PM
^
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