Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 07 Apr 2014 10:51 PM |
I have a tool that allows you to insert a desired speed in a GUI. When you wish to go that speed, you have to double click 'w'. It doesn't do anything. No output.
-- Cizox
r = game:GetService('RunService') bin = script.Parent
player = script.Parent.Parent.Parent humanoid = player.Character.Humanoid runGUI = nil
while true do wait() if player.Character then if player.Character:FindFirstChild("Torso") and player.Character:FindFirstChild("Humanoid") then break end end end
coroutine.resume(coroutine.create(function() while true do wait(0.2) if player.Character.Humanoid.WalkSpeed > 16 then if player.Character.Torso.Velocity.magnitude < 1 then player.Character.Humanoid.WalkSpeed = 16 end end end end))
script.Parent.Selected:connect(function(mouse) runGUI = script.Parent:FindFirstChild("RunGui"):Clone() runGUI.Parent = player.PlayerGui runGUI.RunFrame.Enter.MouseButton1Click:connect(function() mouse.KeyDown:connect(function(key) key = key:lower() t = r.Stepped:wait() click = 0 lastKey = '' if (t - click < .2) and (key == lastKey) then if key:match('w') then humanoid.WalkSpeed = tonumber(runGUI.RunFrame.RunSpeed.Text) or 16 end end end) click = t lastKey = key end) end)
script.Parent.Deselected:connect(function() local runGui = Player.PlayerGui:FindFirstChild('RunGui') if runGui then runGui:Destroy() end humanoid.WalkSpeed = 16 end) |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2014 10:53 PM |
| somthing about running tool, leads me hobberbin, they only work in localscripts now. as in make the script local (i think ur talking about that) |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 07 Apr 2014 10:55 PM |
| It's in a LocalScript, still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2014 10:56 PM |
Hmm yes that code isnt fit for localscript then (or they broke hoppergins AGAIN! >:D) (stupid updates)
--When life give's you lemo's.. BURN HIS HOUSE DOWN >:D-- |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 07 Apr 2014 10:57 PM |
| They still work. I tried this with an earlier version and it works. The only thing I added here is the ability to double tap w. |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
| |
|
|
| 07 Apr 2014 11:14 PM |
find a way to do this or something..
while toolisselected do gui run end? |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
| |
|
Vexeris
|
  |
| Joined: 03 Apr 2014 |
| Total Posts: 468 |
|
|
| 07 Apr 2014 11:39 PM |
| u never changed the speed lol |
|
|
| Report Abuse |
|
|
Swoof
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 16146 |
|
|
| 08 Apr 2014 12:03 AM |
@vex didnt he change it rite here
if key:match('w') then humanoid.WalkSpeed = tonumber(runGUI.RunFrame.RunSpeed.Text) or 16 |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 08 Apr 2014 12:06 AM |
| "humanoid.WalkSpeed = tonumber(runGUI.RunFrame.RunSpeed.Text)" |
|
|
| Report Abuse |
|
|
Vexeris
|
  |
| Joined: 03 Apr 2014 |
| Total Posts: 468 |
|
| |
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 08 Apr 2014 09:18 PM |
| What might be a solution to it? |
|
|
| Report Abuse |
|
|
Vexeris
|
  |
| Joined: 03 Apr 2014 |
| Total Posts: 468 |
|
|
| 08 Apr 2014 09:22 PM |
r = game:GetService('RunService') bin = script.Parent
player = script.Parent.Parent.Parent humanoid = player.Character.Humanoid runGUI = nil
while true do wait() if player.Character then if player.Character:FindFirstChild("Torso") and player.Character:FindFirstChild("Humanoid") then break end end end
coroutine.resume(coroutine.create(function() while true do wait(0.2) if player.Character.Humanoid.WalkSpeed > 16 then if player.Character.Torso.Velocity.magnitude < 1 then player.Character.Humanoid.WalkSpeed = 16 <---- increase the speed here end end end end))
script.Parent.Selected:connect(function(mouse) runGUI = script.Parent:FindFirstChild("RunGui"):Clone() runGUI.Parent = player.PlayerGui runGUI.RunFrame.Enter.MouseButton1Click:connect(function() mouse.KeyDown:connect(function(key) key = key:lower() t = r.Stepped:wait() click = 0 lastKey = '' if (t - click < .2) and (key == lastKey) then if key:match('w') then humanoid.WalkSpeed = tonumber(runGUI.RunFrame.RunSpeed.Text) or 16 end end end) click = t lastKey = key end) end)
script.Parent.Deselected:connect(function() local runGui = Player.PlayerGui:FindFirstChild('RunGui') if runGui then runGui:Destroy() end humanoid.WalkSpeed = 16 end) |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2014 09:23 PM |
No need for tonumber
Because simply, if it is not a number, the script will NOT error, but walkspeed will be set to 0 |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 08 Apr 2014 09:25 PM |
z = key:lower() == "z" plr = game.Players.LocalPlayer if plr.z then plr.Character.Humanoid.Walkspeed = 22 else plr.Character.Humanoid.Walkspeed = 16 end -- I think |
|
|
| Report Abuse |
|
|
Poseidas
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 2659 |
|
|
| 08 Apr 2014 09:46 PM |
@Blade - No.
Anyway...
local lastClickW = 1
player:GetMouse().KeyDown:connect(function() if key:lower() == "w" then local upd = lastClickW local lastClickW = tick() if (tick()-upd) <= .3 then --Doubleclick stuff else --Normal stuff end end end)
~ "It's better to light a candle than to curse the dark" - K'naan |
|
|
| Report Abuse |
|
|
Poseidas
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 2659 |
|
|
| 08 Apr 2014 09:47 PM |
Correction, make lastClickW = 0.
~ "It's better to light a candle than to curse the dark" - K'naan |
|
|
| Report Abuse |
|
|