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 » Scripters
Home Search
 

Re: please help me out

Previous Thread :: Next Thread 
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
07 Aug 2015 03:53 PM
local player = game.Players.LocalPlayer

local char = player.Character;
if not char then
player.CharacterAdded:wait()
char = player.Character
end

local velocity = char.Torso.Velocity

if velocity.Y < -15 then
char.Humanoid.Health = char.Humanoid.Health - 15
end



the error is that it says "Attempt to index local "player" a nil value"
once I get past that error, would it still work?
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
07 Aug 2015 04:11 PM
That whole thing would only run once.
It does seem like it should work.

Also, you can do

local char = player.Character or player.CharacterAdded:wait()
Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
07 Aug 2015 05:22 PM
what do u mean it would only run once?
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
07 Aug 2015 05:38 PM
"local velocity = char.Torso.Velocity

if velocity.Y < -15 then
char.Humanoid.Health = char.Humanoid.Health - 15
end"

That isn't going to keep repeating [I'm assuming you want to check that the torso is always that condition]
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
07 Aug 2015 06:07 PM
repeat wait() until player.Character


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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