its onkey run gui when you press the key "r" its suppose to make you run and the gui bar goes down when keyup it stops going down and recharges to max
Player = script.Parent.Parent.Parent mouse = Player:GetMouse() local active = script.Parent.active.Value local run = script.Parent.run.Value run = 1 active = false function onKeyDown(key) key = key:lower() if key == "r" then active = true if active == true then for i = 0,1,0.005 do wait() script.Parent.Frame.ImageLabel.Size = UDim2.new(run -i , 0, 1, 0) Player.Character.Humanoid.WalkSpeed = 27 end end end end mouse.KeyDown:connect (onKeyDown) function onKeyUp(key) key = key:lower() if key == "r" then print'up' active = false if active == false then for i = 0,1,0.005 do wait() script.Parent.Frame.ImageLabel.Size = UDim2.new(run +i, 0, 1, 0) Player.Character.Humanoid.WalkSpeed = 16 end end end end mouse.KeyUp:connect (onKeyUp)
Closed as Not Constructive by FearMeIAmLag, EzraNehemiah_TF2, and BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?