-
What do you want to achieve? I want to turn my gun from semi-automatic to fully-automatic.
-
What is the issue? I have no idea what code makes a gun turn fully-automatic.
-
What solutions have you tried so far? I’ve tried numerous YouTube videos and searching on Google.
My current server script:
script.Parent.Fire.OnServerEvent:Connect(function(player,mousePos)
player.Character.M4A1.Sound:Play(4642718673)
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {player.Character}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(script.Parent.Handle.Position,(mousePos -
script.Parent.Handle.Position)*300,raycastParams)
if raycastResult then
local hitPart = raycastResult.Instance
local model = hitPart:FindFirstAncestorOfClass("Model")
if model then
if model:FindFirstChild("Humanoid")then
model.Humanoid.Health -=50
end
end
end
end)