generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How come this doesnt work in Play

Previous Thread :: Next Thread 
bigG123 is not online. bigG123
Joined: 17 Feb 2008
Total Posts: 4117
01 Sep 2011 09:31 PM
Only works in Solo.

Speed = 32
Speed2 = 16

bin = script.Parent
local player = script.Parent.Parent.Parent
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))

r = game:GetService("RunService")

local last_click = 0
local last_key = ""

function onKeyDown(key)
print(key)
key = key:lower()
t = r.Stepped:wait()
if (t - last_click < .2) and (key == last_key) then
if key:match("[wasd]") then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = Speed
wait(5)
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = Speed2
wait(5)
end
end
last_click = t
last_key = key
end

function onEquipped(mouse)
mouse.KeyDown:connect(onKeyDown)
end

bin.Equipped:connect(onEquipped)
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
01 Sep 2011 09:38 PM
Is this in a localscript?
Report Abuse
bigG123 is not online. bigG123
Joined: 17 Feb 2008
Total Posts: 4117
01 Sep 2011 09:41 PM
No just a regular one, but it is in a tool.
Report Abuse
superior is not online. superior
Joined: 13 Apr 2008
Total Posts: 1662
01 Sep 2011 09:45 PM
Put in local script.
Report Abuse
bigG123 is not online. bigG123
Joined: 17 Feb 2008
Total Posts: 4117
01 Sep 2011 10:05 PM
Oh mkay, thanks bro.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image