How to add money on leaderboard when typed a code? [Found out how]
Asked by
8 years ago Edited 8 years ago
Wish to make the right code gives some money.
Using Local script
This is the code i'm used before for Twitter code: (Gives money)
It says add is wrong.
01 | script.Parent.Parent.MouseButton 1 Click:connect( function () |
02 | if script.Parent.Parent.Input.Text = = 'CodeTest' then |
03 | game.Players.LocalPlayer. = add 'Money' + 2500 |
04 | script.Parent.Parent.Text = 'Success!' |
06 | script.Parent.Parent.Text = 'Insert Code' |
07 | script.Parent.Parent.Input.Text = '' |
09 | script.Parent.Parent.Text = 'Invalid Code!' |
11 | script.Parent.Parent.Text = 'Insert Code!' |
12 | script.Parent.Parent.Input.Text = '' |
It could be nice If somebody know how to let the code give me money.
Maybe the amount of money giving in the same script.
Using script for now:
01 | local code 1 = "TestCode" |
02 | local p = script.Parent.Parent.Parent.Parent.Parent |
03 | script.Parent.Parent.GO.MouseButton 1 Click:connect( function () |
04 | if script.Parent.Text:lower() = = code 1 :lower() then |
05 | if p:FindFirstChild( 'Code' ..code 1 ) then |
06 | script.Parent.Text = "Already Used!" |
08 | Instance.new( 'Model' , p).Name = ( "Code" ..code 1 ) |
09 | script.Parent.Text = "Redeemed!" |
10 | local money = game.ServerStorage:FindFirstChild( "MoneyStorage" ):FindFirstChild(p.Name) |
11 | money.Value = money.Value + 250000 |