Roblox Scripting Tutorial: Money Giver Button
Hey, guys! Today we're taking a look at how to make a money giver button!
Script:
-- Change this line to the ammount of how much money you would like the giver to give the player.
local give = 1000000
local debounce = false
script.Parent.Touched:connect(function(part)
if not debounce then
debounce = true
-- Checks to see if there is a humanoid inside the same model as the part.
if part.Parent:findFirstChild("Humanoid") then
--Tries to get the player from the character.
local player = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
if player then
-- Check to see if the player has a leaderstats
local leaderstats = player:findFirstChild("leaderstats")
if leaderstats then
local money = leaderstats:findFirstChild("Money") -- Change "Money" to whatever your money is called.
money.Value = money.Value + give
end
end
end
wait(.5)
debounce = false
end
end)
script.Parent.Parent.Name = "Get $" ..give
Be sure to follow me on Twitter after rating, commenting, and subscribing!
https://twitter.com/Rrrrry123
Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123
You can add me on Roblox here!
http://ow.ly/7MWs305jb3B
Want to help make this channel better? You can donate to me via Roblox Robux!
http://ow.ly/En9x30hdeWy
Other Videos By RyGuyGaming
Other Statistics
Roblox Statistics For RyGuyGaming
At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.