Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get what the Client sees?

Asked by 5 years ago

So im making a gun and to avoid exploit, I've been told to do sanity checks and one of which is to check on the server if the player can actually see what they are hitting? I have no idea where to start but I believe there is something to check if a part is in the view of the player.

0
I think having the client tell the server the distance between what is hit and the player that shot is enough. Then the server can compare if it was possible. Viewport is what you are asking for though. xPolarium 1388 — 5y
0
put a script in the localplayer greatneil80 2647 — 5y
0
But what if they are in distance, but the exploiting player fires an event to kill someone behind a wall? Marmalados 193 — 5y
0
You shouldn't have an event that tells the server to kill someone. Just pass the data, like the distance between target player and the shooter, to the server using a RemoteEvent. Don't give power to the client for things like that and you'll be fine. xPolarium 1388 — 5y
View all comments (4 more)
0
I've been told to use distance before, but i dont necessarily know how to, lets say "Event:FireServer(distance)"? Marmalados 193 — 5y
0
Distance would be the magnitude of both Vector3 positions. See it on RobloxDev wiki. xPolarium 1388 — 5y
1
just don't proIua 32 — 5y
0
And how would distance be used in this? I’m not very well equipped in this but I try Marmalados 193 — 5y

Answer this question