ClientCast - A Client-based, Idiosyncratic Hitbox System!

yea it works thanks great module btw

1 Like

Hi I’m back and I have another Issue. For some reason when the player dies Client Cast stops working as seen here combat v2 - Roblox Studio 2021-02-01 00-00-09. I have no idea why this happens but while trying to fix the issue I found out that by changing this line of code from the Client Connection Module from CloneHandler().Parent = StarterPlayer:FindFirstChildOfClass(‘StarterPlayerScripts’) to CloneHandler().Parent = StarterPlayer:FindFirstChildOfClass(‘StarterCharacterScripts’) as seen here Screenshot - cbc1ac9eff1a924b8712cc7214a30e44 - Gyazo pretty much fixes this problem but causes lag after every respawn. Heres the code of me using the module local function Punch() local PhysicalHitbox = game.ServerStorage:WaitForC - Pastebin.com. If I messed up using it or skipped any steps let me know so I can fix this. Other than this issue the module works perfectly.

I believe this could be an issue with your code, as seen in the gif: image

Otherwise, to fix your problem I would need a studio place file with a script that reproduces this issue.

check your messages I sent you the place file. Also just fixed that bug and I’m still having the same issue.

I’ve located the issue - you are deleting the ClientHandler localscript from PlayerScripts, thus not allowing ClientCast to function.

1 Like

Don’t know how that happened but by not using auto set up and setting it up myself it works perfectly. Thanks for pointing me in the right direction.

[Update 1.0.2]

  • Removed Settings methods - I’ve come to realize it is best not to allow runtime editing of debug settings.
  • Added ClientCaster:GetPing() method - if the ClientCaster object has a set Owner, it will return the ping of that player by calculating delay between client-server. NOTE This is a yielding function, and it will yield until it get’s the players ping.
  • Added ClientCaster:SetMaxPingExhaustion(number Time) - determines how long the ClientCaster:GetPing() method can yield for before resuming, to protect against potential exploiting. Default exhaustion time is 1.
  • Added ClientCaster:GetMaxPingExhaustion() - returns how long the ClientCaster:GetPing() method can yield before resuming.
  • Switched from Maid to a slightly altered Janitor for cleaning-up.
  • Updated RBXWait module version.
  • Fixed issue with FilterDescendantsInstances not serializing.
1 Like

[Update 1.0.3]

  • Removed DebugObject in favor of two new Caster methods: DisableDebug and StartDebug. These are real-time alternatives to what was previously offered
  • Added read-only Disabled property of ClientCaster - true by default
  • Removed Janitor module from the code, as it is redundant.
  • Addressed inconsistency with some functions being global
  • Rewrote ClientCaster:Destroy method for consistency
  • Ping returned by ClientCaster:GetPing() is now divided in two - this is because the code previously took into account for the whole two-way trip between the server and the client, rather than just the client
  • Rewrote ReplicationBase class code for consistency
  • ClientCasters have their DebugMode set to Settings.DebugMode by default
  • Removed ClientCaster methods on client that weren’t used
  • The server now sends DebugMode data of Caster to client
  • Attempted method of addressing issue where the client would send hit-data before the server could tell the client that the Caster has been terminated, thus invoking events even after a Caster has been terminated
  • Rewrote signal module
  • Updated RBXWait module to latest version
  • Updated thread with new in-game examples

The wiki has been updated accordingly.

1 Like

Suggestion:
Add a simulation radius option, for ownership. Similar to how Roblox manages Part ownership.

Hitboxes are meant to be bound to only one player throughout their whole lifetime in almost all cases - I don’t know why you would want such a feature.

I was intending to use the hitbox on a rotating killbrick, but didn’t wish to set the ownership to the server or a single player. Therefore my suggestion.

You shouldn’t let clients calculate those sort of hitboxes - I recommend just setting the owner to nil (default).

1 Like

Note

Not an update, but the GitHub repository has been updated with an MIT license due to it being requested.

1 Like

Works well with my melee weapons.

But I wanna ask if it’s a good idea to use this for range too?

[Update 1.0.4]

  • Re-structured the hierarchy - there is now no folder, but rather all scripts are parented under the main ClientCast modulescript.
    image
  • Added Settings.DebugAttachmentName
  • Added Caster:SetRecursive(Bool) - when set to true, the Caster object will search for Raycast points (DmgPoints) from the whole object’s descendants, rather then the object’s direct children. Useful for models and characters.
  • Due to the above change, ClientCast now accepts types other than BaseParts.
  • Added read-only Caster.Recursive property
  • Fixed Caster:SetObject not working as expected
  • When destroying a caster or switching invoking Caster:SetObject, the debug trails are deleted alongside it
2 Likes

If you add and remove DmgPoints the DebugBeams duplicate them selves. I’m not trying to have 300 Attachments in my character at all times, so can you make it so it only creates the debug beams with the current DmgPoints that are inside of the Object you are raycasting from?

[Update 1.0.4.2]

  • You can now parent and destroy DmgPoints without any mishaps (cc. @Splixent)
2 Likes

add something to auto ignore the tool or the model where the DmgPoints are

Is there any type of anti-cheat for this? Players can easily spoof this. For now I think I’ll use ray cast hit box.

You can just use .Magnitude and tick() to check if the hit was valid.