My game isn't FE enabled because I still don't know how that's done but my weapon isn't a tool it's in the camera similar to Phantom Forces and no I'm not trying to copy it I just want to make a COD style game but this is the only problem I have.
function createRay()
local muzzle = gun[gun.Name].Flash
local ray = Ray.new(mouse.Hit.p,(mouse.hit.p-char.Head.Position).unit*s.range)
local hit,pos = workspace:FindPartOnRayWithIgnoreList(ray,{char})
if hit then
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
if human.Health >0 then
player.PlayerGui.HUD.Crosshair.Hit:Play()
player.PlayerGui.HUD.Crosshair.Frame.Hitmarker.Visible = true
if hit.Name == "Head" or hit.Parent:IsA("Hat") then
human = human.Health - s.dmg * s.multi
else
human = human.Health - s.dmg
end
end
end
end
end
The reason I'm not using server scripts is because they can't access the camera so that's why or maybe it can I don't know but it won't work please if someone can explain it to me or tell me what I'm doing wrong that'll be a big help.

5 comments
Forgot to add I'm not good at raycasting or really scripting in general I'm alright I do better an animations so yea there's that.
FE is no longer an option, it is always enabled whether the button is checked or not. Lucky for you most of your script is okay to do locally up to the human part, I would make a script do the rest via a remote event https://www.robloxdev.com/articles/Remote-Functions-and-Events
But how can I do that when my weapon is in the camera? I'm not good with stuff like that... I'm lost
gimme a sec, im gonna try to translate this into a remote event for you
thank you so much