local gun=script.Parent
local plr;
gun.Equipped:connect(function(mouse)
plr=gun.Parent
mouse.Button1Down:connect(function()
local aa=Ray.new(gun.Handle.CFrame.p,(mouse.Hit.p-gun.Handle.CFrame.p).unit*300)
local h,pos=Workspace:FindPartOnRay(ray,plr)
local hum=h and h.Parent and h.Parent:findFirstChild("Humanoid")
if hum then
hum:TakeDamage(30)
end
local dist=(pos-gun.Handle.CFrame.p).magnitude
local bb=Instance.new("Part",plr)
bb.Name="LAZOR"
bb.BrickColor=BrickColor.new("Bright red")
bb.Transparency=0.5
bb.Anchored=true
bb.CanCollide=false--gg no re
bb.TopSurface=1
bb.BottomSurface=1
bb.Formfactor="Custom"
bb.Size=Vector3.new(0.2,0.2,dist)
bb.CFrame=CFrame.new(pos,gun.Handle.CFrame.p)*CFrame.new(0,0,-dist/2)
game.Debris:AddItem(rayPart,0.1)
end)
end)
I don't see a missing variable.. |