i tried to make this code give me 1 strength when i right click using a tool and a lot of web surfing
local tool = script.Parent
local Player = tool.Parent.Parent
local leaderstat = Player.leaderstats.Strength
tool.Activated:Connect(function()
leaderstat.Strength.Value = leaderstat.Strength.Value + 1
end)
this some how worked
local part = script.Parent
local click = part.ClickDetector
local function explode(Player)
Player.leaderstats.Strength.Value = Player.leaderstats.Strength.Value -1
local explosion = Instance.new("Explosion")
explosion.Parent = part
explosion.Position = part.Position
end
click.MouseClick:Connect(explode)
this explodes a block on touch but dosent destroy it and gives -1 point instead of destroying i dont want it to destry pls answer the above one here how i made the strength leader stats local function
local function OnPlayerJoin(Player)
local leaderstats = Instance.new('Folder')
leaderstats.Name = "leaderstats"
leaderstats.Parent = Player
local Strength = Instance.new('IntValue')
Strength.Name = 'Strength'
Strength.Value = 1
Strength.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(OnPlayerJoin)

2 comments
It's okay we're here to help people with errors. some people request for scripts which is not the purpose of this website
thx