attempt to index nil with 'CFrame'?
Asked by
3 years ago Edited 3 years ago
function fire()
local hu=sp.Parent:FindFirstChild("Humanoid")
local he=sp.Parent:FindFirstChild("Head")
local t=sp.Parent:FindFirstChild("Torso")
local team=sp.Parent:FindFirstChild("TEAM")
if handlestofire == 1 then handlestofire = 2 elseif handlestofire == 2 then handlestofire = 1 end
if hu and team and hu.Health>0 and t and he and equipped then
if anim2 and not fireanimloop then anim2:Play() anim2:AdjustSpeed(5) fireanimloop = true end
fireanimdelay = 0.5
local startpos=he.Position
local fakestartpos=(handles[handlestofire].CFrame*CFrame.new(barreloffset)).p
local vec=(sp.Parent.Target.Value.Position-startpos).unit + (Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000)) / (1500*30))