Checking if a Part is ClientSided or ServerSided?

I’m working on a ‘Laser’ gun at the moment and am currently attempting to get it working with ClientSided objects as this is how my Chunks will load in-game.

Is there any way to detect whether a HitPart is ClientSided or ServerSided? That way I’m able to pass the appropriate information over on whether to create a HitPart effect or not.

If it’s client-sided, the server nor other clients will not detect it. So just fire a RemoteEvent asking the server if this is a part. If it’s not, then there’s that.

1 Like

The wall is client-sided, the floor is not.
Now I have a Collision Checker in both my LocalScript and ServerScript meaning that when Colliding with the Wall, only one 1 ‘HitPart’ is generated, as it’s ClientSided and not picked up by the ServerScript. However, when firing on the floor I recieve 2 ‘HitPart’ due to it being recieved by both the Client AND the Server. How could I work around that using RemoteEvent?

Do you want it to only fire server-side or client-side?

1 Like

Ideally to be compatible with both - Typically the way it would work is the ServerSided projectile will pass through all ClientSided objects - I’m trying to avoid this and have it so that ClientSided objects can be detected and generate a ‘HitEffect’ too.

So to clarify, you want it to fire on both? Or be able to fire on both?

1 Like

I just want the visuals to be available on both - IE:
If the Laser collides with something, a Part is created (( HitPart )) that’ll have a ParticleEffect in it to visually show it has collided.

I want this to operate on both Client and Server without the issue I’m currently facing of it doubling up due to noting both ServerSide and ClientSided collisions when hitting a ServerSided Part.

So basically if I understand correctly, detect if it hits client-side ONLY. ONLY have a hit detector coded client-side.

Then, when registered client-side, send the RemoteEvent with the client’s name to the server.
From the server, it fires all clients EXCEPT the one that fired it (through for loops and if statements). Create the result there.

2 Likes