just started making shooting games at the beginning of the year with acs 2.0.2 gun engine.
I looked google how to install it. When I tried it I was very impressed with this but the problem is to aim the gun, why does it have to press the right click button to aim instead of normally hold right click button to aim anyone, is there a solution or rewrite code ?
1 Like
you can try this which does the aim animation when the player is holding the right button
local uis = game:GetService("UserInputService")
local plrchr = game.Players.LocalPlayer.Character or game.Player.LocalPlayer.CharacterAdded:Wait()
local hum = plrchr["Humanoid"]
local equipped = false
local loadedaimanim = hum:LoadAnimation(script["Aim"])
script.Parent.Equipped:Connect(function() equipped = true end)
script.Parent.UnEquipped:Connect(function() equipped = false end)
uis.InputBegan:Connect(function(key, gpe)
if gpe then
return
end
if not equipped then
return
end
if key.UserInputType == Enum.UserInputType.MouseButton2 then
loadedaimanim:Play()
end
end)
uis.InputEnded:Connect(function(key, gpe)
if gpe then
return
end
if key.UserInputType == Enum.UserInputType.MouseButton2 then
loadedaimanim:Stop()
end
end)
after you copy this code create a local script inside of the gun and paste the code there
and im not in studio rn so bugs or errors can occur and also view the localscript of the gun system
which makes the โpress to aimโ thingy
if the system contains alot of lines then i suggest you pressing ctrl + f and search โaimโ or anything else that will help and after you find these lines just simply remove them.
1 Like