Hey, I need help with this, I am creating a game where you save a 'hostage' from the enemy and you earn points from it. I am not sure how to award the points to the player who clicked. Can anyone explain how to do this?
Hello! You should either use StringValue or NumberValues. First, if you already have a leader board then good. Otherwise, make sure you have one before posting a next step question.
Anyway here are some instructions;
- Make sure you have your button 2, Make sure you have a local Script inside that button
if you have those steps done then we can start, in the local script type this code in;
local button = script.Parent -- The button local Player = game.Players.LocalPlayer local Currency = Player.leaderstats.Coins --Change this to where your currency is button.MouseButton1Down:Connect(function() Currency.Value = Currency.Value + 1 -- You can change 1 to how much they get end)
This is a very basic script as well, I hope you learn some basics before asking a simple question. Questions like these may be moderated. But anyway I hoped I helped and if I did then please accept answer ;)