Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

is it the contextactionservice or lookvector? help

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

0

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

1 answer

Grammatical Error, CFrame accepts, LookVector, and lookVector.

Hope That Helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.