local Fireball = game.ServerStorage:WaitForChild("Fireball")
--Put tool they should have here
local tool = slapper
game.ReplicatedStorage.Fireball.OnServerEvent:Connect(function(player,cframe)
local character = player.Character
--Check if tool equipped, otherwise return/exit function
if character:FindFirstChild(tool.Name) == nil then return end
local newFireball = Fireball:Clone()
newFireball.CFrame = character.HumanoidRootPart.CFrame
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Velocity = (character.HumanoidRootPart.CFrame.lookVector*100)
bodyVelocity.Parent = newFireball
newFireball.Parent = workspace
local touchConn
touchConn = newFireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= player.Name then
local humanoid = hit:FindFirstAncestorWhichIsA("Model").Humanoid
humanoid:TakeDamage(25)
if touchConn ~= nil then touchConn:Disconnect() end
newFireball:Destroy()
end
end
end)
wait(2)
if touchConn ~= nil then touchConn:Disconnect() end
newFireball:Destroy()
end)
COMMUNITY QUESTION
Ok so i want this script to work only when the slapper tool is equipped so what am I doing wrong?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
When I told you to "put the tool here," I didn't mean literally. You should index the tool from wherever it is stored. Perhaps consider learning the basics about game hierarchy first: https://www.youtube.com/watch?v=BfLUt3mfJiY
Isn't Tool.Equipped an event?