#making a 3rd person gun
1 messages · Page 1 of 1 (latest)
If you have semi automatic weapons, you'll have to fire a remote event everytime the player shoots but also have a cooldown on the server to prevent exploiters from spam-firing the remote event
For automatic weapons, just like you suggested
You could also use an attribute/BooleanValue on the server and switch it, it will replicate to all clients and new clients automatically, if true, fire
i also tried doing that, but dude that's alot for the server to handle, constant remote events fired cause bad performance
You have no other way of sending the information
Also, all you're doing is firing the remote event without data
it's not bad
i forgot to mention this VERY important something:
the player's camera ray is assigned using the player's current camera ==> this right here is the cause of this whole problem
only if i could access a player's current camera without having to do it locally
im firing it with the ray's data, to know which way, position ... (bullet info) to render
I change my question
is there any way i can do somethin like this
⚠️⚠️ THIS LOCAL SCRIPT IS FROM SUPHI ⚠️⚠️
local function calculate_ray()
local cam = workspace.CurrentCamera
-- calculate ray with the suphi's cam
end
⚠️⚠️ THIS LOCAL SCRIPT IS FROM CAPSORI ⚠️⚠️
local function calculate_ray()
local cam = workspace.CurrentCamera
-- calculate ray with the capsori's cam
end
⚠️⚠️ THIS LOCAL SCRIPT FROM CAPSORI WANTS TO GET SUPHI S CAMERA⚠️⚠️
local Suphi = game.Players.suphi
local suphi_cam = Suphi.CurrentCamera ???
local function calculate_ray()
-- calculate ray from capsori's client side with suphi's camera
end
This is very easy in my eyes
you need to
detect mouse click/hold
then send the mouse direction
I'll explain later how to do it because I have piano class
If I remember correctly, you have to use this function to find out the mouse direction
to detect if they holding click u could simplyuse a variable named "shooting" and repeat wait until that variable is false
the problem is in sending the mouse direction
from one side, i cant be firing multiple events sending the direction to the server at once (that will cause performance problems)
and from another side i dont have any other way to access the ViewportPointToRay of another player's camera
you only need to send essential data to the server, such as where the raycast starts, and the direction.
Firing this often doesn't cause performance problems. Performance issues only come from sending a lot data too often
sending two vector3s isn't anywhere close to the network send/receive limit. You could fire this 100 times per second and the remotes could handle it