i don't have strong understanding of the lookvector but i have a higher understanding of cas(contextactionservice)
local repl = game:GetService("ReplicatedStorage")
local gunf = repl:WaitForChild("Gun")
local PG = gunf:WaitForChild("PG")
local armf = repl:WaitForChild("Arm")
local armg = armf:WaitForChild("Arms")
local player = game:GetService("Players")
local runservice = game:GetService("RunService")
local cc = workspace.CurrentCamera
local gun = PG
local cas = game:GetService("ContextActionService")
local debris = game:GetService("Debris")
if repl and gunf and PG and armf and armg and player and runservice then
---script run
--arm
armg.Parent = workspace.Camera
PG.Parent = armg.Parent
runservice.Heartbeat:connect(function(T)
armg:SetPrimaryPartCFrame(cc.CFrame)
PG:SetPrimaryPartCFrame(armg.r.CFrame)
end)
function s(shoot,inputs,inputo)
if inputs == Enum.UserInputState.Begin then
local b = Instance.new("Part",PG.Base)
b.Position = PG.Base.Position
b.Velocity = b.CFrame.lookvector * 200
print("shoot")
end
cas:BindAction("shoot",s,false,Enum.UserInputType.MouseButton1)
end
end

1 comment
Console output or a description of the issue would go a great deal in helping us help you.