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: Swimming:connect only works when going different speeds?

Previous Thread :: Next Thread 
Sithex is not online. Sithex
Joined: 30 May 2010
Total Posts: 1757
23 Jun 2014 08:44 PM
it only takes damage when you go different speeds.. like say if you held down the same arror key it wouldn't do anything until you let go or moved a different direction
any fix?

human = game.Players.LocalPlayer.Character
human.Humanoid.Swimming:connect(function(speed)
human.Humanoid:TakeDamage(1)
end)
Report Abuse
Sithex is not online. Sithex
Joined: 30 May 2010
Total Posts: 1757
23 Jun 2014 09:11 PM
bump

#Tab::Run www.roblox.com/
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
23 Jun 2014 09:15 PM
Oh, you're trying to make a drowning function.

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character
local hume = char:WaitForChild("Humanoid")
local drown = false

hume.Swimming:connect(function(chk)
if chk then drown = true; else drown = false end
end)

while wait(1) do
if drown then hume:TakeDamage(1)
end end
Report Abuse
Sithex is not online. Sithex
Joined: 30 May 2010
Total Posts: 1757
23 Jun 2014 09:21 PM
wow why didnt i think of that qq

Thanks

#Tab::Run www.roblox.com/
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