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.
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.
Is there a way to implement a feature to toggle debug for a specific client?
Say there’s a settings menu, I want a ‘Debug’ option that you can toggle on and off.
How do you make it so that the module’s rays are debugged by a specific client?
ClientCast is meant to be barebones so that you can easily implement this sort of functionality yourself. What I do for my game is have a simple if-statement check in the localscript where the raycast is done - you could easily setup a remote event to listen to the server, and then use attributes to tell the localscript when to visualize the raycasts.