cdw100100
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 23 |
|
|
| 12 Aug 2013 02:57 AM |
It works in solo ad tools >test>start server and tools.test.start player but it didnt work when i played the game why? I tis in a normal script
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent local Energy = script.Parent local mouse = Player:GetMouse() local Sprint = false
function onKeyDown(key) key = key:lower() if key == "z" then Sprint = true Run() Walk() end end
function Run() Player.Character.Humanoid.WalkSpeed = 25 while Sprint == true and Energy.Value > 0 do wait(0.1) Energy.Value = Energy.Value - 1 end end
function Walk() while Sprint == true and Energy.Value == 0 do wait() Player.Character.Humanoid.WalkSpeed = 16 end end
function onKeyUp(key) key = key:lower() if key == "z" then Sprint = false Player.Character.Humanoid.WalkSpeed = 16 end end
mouse.KeyUp:connect(onKeyUp) mouse.KeyDown:connect(onKeyDown) |
|
|
| Report Abuse |
|
|
Maileh
|
  |
| Joined: 14 Jun 2011 |
| Total Posts: 1067 |
|
|
| 12 Aug 2013 03:05 AM |
:GetMouse() that gotta be a in localscript |
|
|
| Report Abuse |
|
|
cdw100100
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 23 |
|
|
| 12 Aug 2013 03:08 AM |
| Thank you I was testing and i tryed local scripts and they worked. But thank you anyways. |
|
|
| Report Abuse |
|
|