Vlocity - A velocity-based damage script

Vlocity

Vlocity is a modular velocity-based damage system which features a velocity prediction beam that turns red when the impact can most likely do damage (the beam isn’t entirely accurate) however it does work on both R6 and R15 though it works a bit differently between the two (in which I’m not too sure of why)

An example of it on R6:

An example of it on R15:

Settings that are featured:

  • Minimum Velocity
  • Maximum Velocity
  • Forgiveness
  • Show Velocity Beam

To change the settings mentioned above, open the config under the script and change the values.

  • And an attribute called Resistance is also featured which is basically forgiveness but is instead modified by other scripts.
    An example of Resistance being used:
    character:SetAttribute(“Resistance”, 1)
    That line would make the player immune to the velocity damage IF the character is defined in a local variable.

Changelog:

  • Configuring is now more straight-forward.
  • Moved the raycast perams above the heartbeat function.

More info on Vlocity:

The damage is calculated in all directions which can be good for detecting if the player is launched really fast into an object. I have yet to add a feature where you can disable specific axes.

Disclaimers: As said the way damage is calculated acts differently on R6 than it does on R15, and the damage isn’t entirely accurate.

With that being said, we are open for feedback and here’s the link to the model;

Vlocity - Velocity based damage

And finally, have a great day!

7 Likes

This would be in the Resources > Community Resources category.

Looks nice man! Well done

2 Likes

image
This can be bypassed via exploits :>

image
Since it’s constant, you could’ve store it somewhere, making less time and memory consumption.


Each player’s respawn you’ll make a new Heartbeat event which’ll call functions. Inefficient for long runs. Also using attributes is meh.

image

You shouldn’t make a new raycastparams each time. It’s expensive in terms of time and (if called a lot of times) memory

image

vector library would be better for that and making CFrame for simple position change is strange. Could’ve been simplified to CFrame.new(startpoint-vector.create(0,0,beamLength/2),endPoint). It’s actually alright to use Cframe.new() for that.

Anyways, pretty good for educational purposes and already made feature for game!

3 Likes

Attributes are more efficient than number values.

1 Like

And I wasn’t talking about ValueBase instances.

1 Like

disabling fall damage isn’t that critical in most cases, so it’s useless to secure the code against exploiters.

5 Likes

It’s still unpleasant to have someone have a subtle advantage over others.

1 Like

though it’s far better than them flinging you away from the map, often resetting the progress

4 Likes

how would it be fixed? can you provide some code examples? thanks