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: large knockback instead of death

Previous Thread :: Next Thread 
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 07:46 PM
Does anybody have a nice script that makes it so instead of dying from having 0 HP, your HP can't go below zero and instead you just take a set amount of knockback
Im trying to make a smash brothers inspired game but every move having knockback that scales is too intimidating right now.
I'll accept simple help if you don't want to just drop a script
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Mar 2016 07:50 PM
I don't really have the time to write the script now, but I suggest you use your own variables for health. Once the current health variable is below the max health variable, have the player's torso be CFramed the opposite direction the player is facing (maybe with some upward direction). That's just one way to go about it.


~MightyDantheman
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 09:03 PM
would 'BodyVelocity' work?
and if so how do i make it so it launches them in the opposite direction?
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 09:05 PM
to clarify what I said, all I need to know is how to make it so the velocity is the opposite of their facing direction
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Mar 2016 09:11 PM
If you're using a 2D plat-former, find the player's angle, and use body velocity in the opposite direction. You can do this by using an if statement to recognize if the player's angle is within a certain range (you'll have to find which one (x,y,z)), then fly a certain direction. Do this again, but for the opposite direction. There's a way to get the direction of which the player is facing, but I don't have that memorized, so I don't quite remember how.


~MightyDantheman
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 09:14 PM
by angle, do you mean something like the rotation of the torso? or some other thing I don't know about or don't remember
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Mar 2016 09:15 PM
Rotation should work.


~MightyDantheman
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
18 Mar 2016 09:35 PM
-lookvector

bodyvelocity.velocity = Vector3.new(-char.Torso.CFrame.lookVector)
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 10:04 PM
maybe im doing something wrong but neither of these are working
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 10:11 PM
wait, is it possible to do stuff with each separate X Y and Z of rotation?
Report Abuse
Axnew is not online. Axnew
Joined: 16 Jul 2014
Total Posts: 20
18 Mar 2016 10:19 PM
oh nevermind, it is fixed
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Mar 2016 10:49 PM
Yes it is, same with position. Example:

local pos = part.Position
pos.Position = Vector3.new(pos.X,pos.Y + 10,pos.Z)
-- To make the part go up 10 studs from it's current position.


--//


~MightyDantheman
Report Abuse
riftg is not online. riftg
Joined: 24 Nov 2008
Total Posts: 1980
19 Mar 2016 12:14 AM
983B7505

@MightyDantheman
I am using Telnet as a browser. Doing this by using an if statement to recognize if the player's angle is within a certain range (you will have to find which one (x,y,z)), then fly a certain direction is not among my strongest traits. Ask it does. I think you already know the answer. Where? Where is that?
jk I don't mean it

RiftG never sleeps
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