Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Adding 500 to only my leaderstats?

so my leaderboard code is below or wherever but I wanna be a able to press a button and add money to only me. I have a button in a frame in starter Gui I have code to make it so only I can have it and I wanna make it so If I press the button it adds 500 only me and not others. I also have a frame in starter gui that shows your money so if that's a problem let me know.

Leaderboard script its in workspace

game.Players.PlayerAdded:connect(function(player)
	local leader = Instance.new("Folder",player)
	leader.Name = "leaderstats"
	local Cash = Instance.new("IntValue",leader)
	Cash.Name = "Cash"
	Cash.Value = 0
end)

The screen gui code that shows your amount of money it is put in starter gui

local Cash = script.Parent.Parent.Parent.Parent.Leaderstats.Cash
Cash.Changed:connect(function()
	script.Parent.Text = "Cash: $"..Cash.Value
end)

Thanks for the help mate!

1 answer

Frame.TextButton.MouseButton1Down:Connect(function() --or where ever the text button is located
if game:GetService("Players").LocalPlayer.Name == "Beep_Boop06" then
Cash.Value = Cash.Value + 500
end
end)

3 comments

0

you got a video where i can learn scripting mate im kinda new?

This discussion is preserved as it was. New answers, comments, and votes are closed.