Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make a money system that add $0.50 to a textlabel each time i get a kill?

Asked by
Choobu 59
6 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

I kept trying and tryping to make a script that, whenever you kill someone you get 0.50 cents or $0.50 from killing them and it will keep adding up.

I put it as a startergui with screengui and inside of it is a imagelabel, then a textlabel telling you how many coins you have so is there anyone willing to help me figure this out all i really want it to do is just add $0.50 to the textlabel each time you get a kill i tired adding a killing script from youtube but it adds the money into a leaderboard and not text label.

1
I would like to stress that this is not a good way to go about doing this, not only because it is inefficient and hacky but because it is exploitable. If the only thing that matters is a textlabel, then the client could simply exploit the text. Please rethink your design. byc14 96 — 6y
1
Instead, the textlabel should only reflect the data which is securely stored on the server with no direct client interaction. byc14 96 — 6y
0
He's right. This is exploitable and is not recommended unless you want it badly enough. magicguy78942 238 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Just add this in a localscript inside of your textlabel and it should work. Let me know if you have any problems. Its 2am and I dont feel like testing it but will check it in the morning. BTW you also need to set your leaderstats up so it can add .50 to the leaderstats. To do that just find a leaderstat script and make sure to name the leaderstat Money

player = game.Players.LocalPlayer
Money = player.leaderstats.Money

Money.changed:connect(function()
script.Parent.Text = Money 
end)
Ad

Answer this question