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: My Fall Damage script isn't working?

Previous Thread :: Next Thread 
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 10:54 AM
[ Content Deleted ]
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
22 May 2014 10:56 AM
Character doesn't load instantly. Wait for it to load.

Also your loop will never stop damaging your player once it starts.
Report Abuse
Argelius is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
22 May 2014 10:56 AM
do FreeFalling event. FallingDown is for when you get tripped.
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 10:58 AM
[ Content Deleted ]
Report Abuse
Argelius is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
22 May 2014 10:58 AM
CharacterAdded event
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
22 May 2014 10:59 AM
game.Players.PlayerAdded:connect(function(p)
repeat wait until p.Character
p.Character.Humanoid.FallingDown:connect(function()
while true do
wait(1)
p.Character.Humanoid.Health:TakeDamage(3)
end
end)
end)
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
22 May 2014 10:59 AM
Keep checking if the character exists until it exists.

http://wiki.roblox.com/index.php?title=Loops#Repeat
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
22 May 2014 10:59 AM
ignore me actually sorry lol
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
22 May 2014 10:59 AM
Way to go smiley599. You denied him the chance to learn.
Report Abuse
Argelius is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
22 May 2014 11:02 AM
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
p.Character.Humanoid.FreeFalling:connect(function()
while true do
p.Character.Humanoid.Health:TakeDamage(3)
end
end)
end)
end)
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:03 AM
[ Content Deleted ]
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 May 2014 11:04 AM
Do not hse the repeat wait() until one that smiley posted
Use CharacterAdded
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:04 AM
[ Content Deleted ]
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:07 AM
[ Content Deleted ]
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
22 May 2014 11:08 AM
yeah i said ignore me because i saw there was no character added and i didnt want to do #lazy
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:11 AM
[ Content Deleted ]
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 May 2014 11:15 AM
Also OP
You could clean your script up a little, example
while true do
wait(1)
--whatever you did, Im on a iphone and so can't look at it
end

while loops take a condition, a condition will pass if the value is anything other than nil, or false

while 1 do
wait(1)
end
Will run forever

wait(1) returns the amount of time it waited, a number is not false or nil so
while wait(1) do
--stff
end
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:31 AM
[ Content Deleted ]
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 May 2014 11:35 AM
Take away the .Health and call take damage on the humanoid
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:37 AM
[ Content Deleted ]
Report Abuse
Argelius is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
22 May 2014 11:39 AM
Are you using a while loop without a wait?
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
22 May 2014 11:41 AM
[ Content Deleted ]
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 May 2014 12:08 PM
If you are gonna break the while loop after it runs once you don't even need the while loop
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