Hi Guys. Just made a simple Gui Button script below that changes player walkspeed.
How do I amend this so that it only changes walkspeed on CharacterAdded so as to only change walkspeed on respawn instead of immediately...?
Tried a bunch of stuff and it feels like it should be simpler than I'm making it out to be..
Thanks in advance!
Player = script.Parent.Parent.Parent.Parent.Parent
Cost = 1
script.Parent.MouseButton1Click:connect(function()
if Player:findFirstChild("skills") then
if Player.skills.Talents.Value >= Cost then Player.skills.Talents.Value = Player.skills.Talents.Value -Cost
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed + 2.5
script.Parent.Parent.DasherBought.Visible = true
end
end
end)

1 comment
http://robloxdev.com/articles/Writing-Clean-Code