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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 18 Mar 2016 09:15 PM |
Rotation should work.
~MightyDantheman |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2016 09:35 PM |
-lookvector
bodyvelocity.velocity = Vector3.new(-char.Torso.CFrame.lookVector) |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 16 Jul 2014 |
| Total Posts: 20 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|