I have a script to make the gun firepos follow a humanoid when it detects a humanoids body part, but since the gun is welded and i have to keep it welded to connect the parts it does this happends.
localscript
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Move:Connect(function(hit)
if mouse.Target then
if mouse.Target.Parent:FindFirstChild("Humanoid") then
script.Parent.rotateRE:FireServer(mouse.Target.Position)
end
end
end)
serverscript
script.Parent.rotateRE.OnServerEvent:Connect(function(plr,pos)
script.Parent.CFrame = CFrame.lookAt(script.Parent.Position,pos)
end)
this does not make the actual gun visually follow the mouse, it just shoots the bullets to the direction of the players mouse but it doesn’t work the way i want it to.