game.Players.PlayerAdded:connect(function(player) player.characteradded:Connect(function(char) local data = Instance.new("Folder", player) data.Name = "Stats" local Strength = Instance.new("IntValue", data) Strength.Name = "Strength" Strength.Value = 0 local Defense = Instance.new("IntValue", data) Defense.Name = "Defense" Defense.Value = 0 local Agility = Instance.new("IntValue", data) Agility.Name = "Agility" Agility.Value = 0 local Skill = Instance.new("IntValue", data) Skill.Name = "Skill" Skill.Value = 0 end) end)
For this to work put a click detector inside the button.
local button = script.Parent -- replace with the location of the button button.ClickDetector.MouseClick:Connect(function(player) player.Stats.Strength.Value = player.Stats.Strength.Value + 1 player.Stats.Defense.Value = player.Stats.Defense.Value + 1 player.Stats.Agility.Value = player.Stats.Agility.Value + 1 player.Stats.Skill.Value = player.Stats.Skill.Value + 1 end)
if it doesn't work tell me.
wait() local button = script.Parent local player = game.Players.LocalPlayer local stats = player:WaitForChild("stats") button.MouseButton1Click:Connect(function() stats.Strength.Value = stats.Strength.Value + 1 stats.Defense.Value = stats.Defe.Value + 1 stats.Agility.Value = stats.Agility.Value + 1 stats.Skill.Value = stats.Skill.Value + 1 end)
?