Hello, I'm trying to make a Balefire tool, like the old ones of 2009. However, it doesn't seem to be working. Here's what I've tried:
print("Balefire Spell Loaded")
local COOLDOWN = 0.1
bin = script.Parent
function balefire(pos)
local player = game.Players.LocalPlayer
if player == nil or player.Character == nil then return end
local char = player.Character.Torso
dir = (pos - char.CFrame.p).unit
for i = 1, 50 do
local ex = Instance.new("Explosion")
ex.BlastRadius = 3
ex.BlastPressure = 999999
ex.Position = char.CFrame.p + (dir * 6 * i) + (dir * 7)
ex.Parent = game.Workspace
end
end
enabled = true
function onButton1Down(mouse)
if not enabled then
return
end
local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
-- find the best cf
local cf = mouse.Hit
local v = cf.lookVector
script.Parent.Sound:Play()
wait(2)
balefire(cf.p)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true
end
function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
Oddly, it works in Solo and Studio, but not online.
Any help is appreciated, thanks!

1 comment
I forgot to make the script a LocalScript, I made it a normal Script. Thanks!