hi. I am trying to make a gun and it doesnt really work.
script.Parent.Parent.Activated:Connect(function()
wait(.5)
local part = Instance.new("Part",workspace)
part.Size = Vector3.new(.5,.5,.5)
part.BrickColor = BrickColor.new(255,255,0)
part.Transparency = 0
part.CanCollide = false
part.Position = script.Parent.Position + Vector3.new(-10,0,0)
wait(.5)
local originalposition = part.Position
while wait(.5) do
part.Velocity = part.Velocity + Vector3.new(12,12,12)
end
part.Touched:Connect(function(hit)
local h = hit.Parent:WaitForChild("Humanoid") if h ~= nil then
wait(.5)
h:TakeDamage(30)
end
end)
end)
when i use it the bullet doesnt even get launched it just spawns and falls on the floor and when the bullet hits a npc it doesnt get damaged. Help? :)

1 comment
ok thanks!!