Remote event or while true do?

Your answer already won the solution, but what did the user weakroblox35 mean with:

1 Like

I think they are either misinformed or they are talking about how you can have the client tell the server that it hit something, and then just have the server validate that the thing the client hit is within line of sight, meaning the server doesn’t need to know the direction fired, just the position hit, the issue with this is that it’s less secure than other methods

1 Like

the beam would be launched from the server what the client would do is send the mouse position

1 Like

in the situation described it would be like

Client reads mouse 1 input
Client checks if it has ammo and it hasn’t been too short of a time since last shot
client makes bullet effect
client fires gun remote event with hit target
Server checks if client has ammo, is in sightline of target, and if it hasn’t been too short since the last shot
Server detracts an ammo from gun and hp from the target
Server tells all the other clients to show the bullet effect

only one remote is fired, but its pretty insecure and honestly not worth it compared to the alternatives

Last question: which method is safer?

although a furry bird told me that roblox updated
its security, also I would send only the position in which it intersects, and the server decides the origin

you should have the client send the vector in which it’s looking whenever it tries to fire a shot, although technically it’s not the most secure, roblox’s limitations make it one of the most reasonable things to do

1 Like

I got it confused with projectiles since I tend to use mouse position for projectile throwing and yes you can use FastCast.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.