This script works in ROBLOX Studio, but not in ROBLOX itself.

wait()
using=false
player=game.Players.LocalPlayer
mouse = player:GetMouse()
eq = false
h = player.Character:WaitForChild("Humanoid")

Sweep = h:LoadAnimation(script.Parent.Sweep)

script.Parent.Equipped:connect(function()
eq=true
end)

script.Parent.Unequipped:connect(function()
eq=false
end)

mouse.Button1Down:connect(function()
if eq==true and using==false then
using=true
Sweep:Play()
script.Parent.Dust.ParticleEmitter.Enabled=true
wait(.75)
script.Parent.Dust.ParticleEmitter.Enabled=false
wait(1)
using=false
end
end)

Any help on why this error is occurring?