I simply want to know why this code does not work, the error is in the title, here is the script(The error is in line 41):
tool = script.Parent
player = game.Players.LocalPlayer
mouse = player:GetMouse()
reload = true
tool.Activated:connect(function()
if reload == true then
reload = false
local Part = Instance.new("Part", workspace)
Part.Size = Vector3.new(0.1,0.1,0.1)
Part.Shape = ("Ball")
Part.Position = Vector3.new(-3.5,0.5,4.5)
Part.CFrame = tool.Handle.CFrame
Part.CFrame = CFrame.new(Part.Position,mouse.Hit.p)
local v = Instance.new("BodyVelocity", Part)
v.velocity = Part.CFrame.lookVector *90
v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Part.Touched:connect(function(hit)
if hit.Name == "Snow" then
local Snow = hit
Snow.Transparency = 0.1
wait(0.1)
Snow.Transparency = 0.2
wait(0.1)
Snow.Transparency = 0.3
wait(0.1)
Snow.Transparency = 0.4
wait(0.1)
Snow.Transparency = 0.5
wait(0.1)
Snow.Transparency = 0.6
wait(0.1)
Snow.Transparency = 0.7
wait(0.1)
Snow:Destroy()
Part:Destroy()
end
end)
wait(3)
reload = true
end)
