When I enable Debug in settings it works the first time but it doesn’t seem to after that. I think this has to do with setting self._Debug
to false in DisableDebug()
(which is called automatically in Stop()
) which prevents StartDebug()
from being called again, which also prevents it from telling the client to start debugging as well. All I did was remove the self._Debug = true
and self._Debug = false
in StartDebug()
and DisableDebug()
, but kept the ReplicationConnection
updates in and it stayed debugging as expected.
Good catch! I’ve pushed an update to both the github & the Roblox module - could you update and confirm that this has been fixed on your end?
Seems to work, one other thing I wanted to mention is that Recursive doesn’t seem to replicate when you do SetRecursive
. I was looking into the code and saw that a caster is only made on the client when Start
is fired which means that you’ll need to start the hitbox at least once in order to apply updates to it (like setting recursive). I think it’d be beneficial to add caster creation to Update
as well so that this works:
Hitbox = ClientCast.new(Tool, params, Player)
Hitbox:SetRecursive(true)
as right now this doesn’t because Caster
is nil
on the client until you start it once.
You already have the functionality to create a caster on the client if it doesn’t exist so it should just be able to be copy pasted into the update function as well.
Update 1.0.5.0
- Casters on the client can now have their methods be updated without having to use the Start method prior
cc. @steven4547466
Update 1.0.6.0 [IMPORTANT UPDATE]
- A bug has been fixed in regards to raycasts actually raycasting in the opposite direction - I frankly have no idea how this went by unnoticed for so long, but I have noticed this on accident and thus fixed it. Please update to make sure this bug is fixed for you all also.
Update 1.0.7.0
-
Switched to " (double quotation marks) instead of ’ (single quotation marks) to stay consistent with Roblox code.
-
Switched out coroutine.resume for task.spawn, which does not break continuations.
-
GetPing is no longer divided by two, as ping is a two-way trip rather than one-way.
General tip:
if you’re calculating your hitbox on the client, please also validate on whether the hit-position is accurate, as exploiters could spoof this value whenever it’s being sent over to the server. There is no one reliable way to verify this, and as such you should program your own solutions depending on the context.
Update 1.0.8.0
-
Client no longer sends Humanoid along with the HumanoidCollided remote, but rather the server verifies whether the instance has one or not when it receives the data.
-
Collided & HumanoidCollided events are now destroyed when the Caster object is destroyed.
-
RaycastResult.Instance
is now checked for whether it’s nil or not if sent from the client.
hello! this seems very useful and stuff, but how do you make it so it doesn’t count accessory’s parts as the humanoid?
In HumanoidCollided, simply add a if not Object:IsA("Accessory") then
check.
The line it’s erroring on is
if Attachment.ClassName == "Attachment" and Attachment.Name == Settings.AttachmentName and not DamagePoints[Attachment] then
I’m assuming what’s going on is that you somehow parented a Roblox-locked object as a child or descendant - be it by accidentally setting the model to game
, workspace
or similar, or by other black wizardry.
The only case in which such an error would occur is when attempting to index Roblox-locked objects.
Could you verify that the model, and it’s descendants, are expected - ie., that it’s not something like workspace
or game
? You can check by going to line 423 in the module, and adding a print(CasterObject.Object:GetFullName())
to see what the object is set to.
I was told in a tutorial to put the script in ServerScriptService and the module in ServerStorage (if I put it in replicatedstorage the same thing happens)
by “object”, I mean the object you set the ClientCaster’s hitbox as - ClientCast.new(**Object**)
Also, could you try adding a print as mentioned above?
Where would I put the print though? If I put it under the line it would obviously not work, and if I put it above it would work but I probably wouldn’t be able to see it since the output would be spammed with errors.
Why would it not work on the line before? Also, you can filter the console to only show output/information and to hide errors.
Please read the thread fully before mentioning exploiters. I’m well aware of it.
It says the name of my game:
But the part is in workspace…
Well, it seems like you’re somehow passing the game as the object. Try using breakpoints to see what CasterObject
is.
I hate autocomplete