Well I tried a lot of time to find out how to do it but I can't really understand can someone help me?
The script: local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed + 1
Player.leaderstats.OOF.Value = Player.leaderstats.OOF.Value + 1
game.Workspace.Sound:Play()
script.Parent:Destroy()
end)
I think you missed out this line of code
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed + 1
So this finishing code should be
local Player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed + 1 Player.leaderstats.OOF.Value = Player.leaderstats.OOF.Value + 1 game.Workspace.Sound:Play() script.Parent:Destroy() end)
Hope this helps..
While xviperlink's code works, it can be cleaned up a little. I presume that script.Parent.Parent.Parent.Parent is the player, so just use that variable, also,
PLEASE INDENT YOUR CODE!
So a cleaner local script might look something like this:
local char = game.Players.LocalPlayer.Character local hum = char:FindFirstChild(""Humanoid") script.Parent.MouseButton1Click:Connect(function() if hum then--check if the humanoid exists hum.WalkSpeed = hum.WalkSpeed + 1 end end)