It for some reason doesn't work, as I have a tool which does is clones the tool into the users backpack. I tested it in starterpack, which it worked, but when I input it in the script of that tool and cloned it to the backpack, it for some reason doesnt function. This is the local script of my tool i have been trying to make work.
local tool = script.Parent
local player = game.Players.LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local hum = player.CharacterAdded:Wait():WaitForChild("Humanoid")
local TweenService = game:GetService("TweenService")
local mouse = player:GetMouse()
local BarrageEvent = rp:WaitForChild("VampiricBarrage")
local holdingdown = false
local holdingdowncooldown = 0.66666668653488
--[[
tool.Activated:Connect(function()
BarrageEvent:FireServer(tool)
end)
]]
function checkTool(character,toolName)
for _, v in pairs(character:GetChildren()) do
if v:IsA("Tool") then
if v.Name == toolName then
return true
end
end
end
return false
end
mouse.Button1Down:Connect(function()
if checkTool(player.Character,tool.Name) then
holdingdown = true
repeat
BarrageEvent:FireServer(tool)
wait(holdingdowncooldown)
until not holdingdown
end
end)
mouse.Button1Up:Connect(function()
if checkTool(player.Character,tool.Name) then
holdingdown = false
end
end)
tool.Unequipped:Connect(function()
holdingdown = false
end)

3 comments
scripts dont work in replicated storage
^^^
It was cloned in replicated storage, and then parented into player backpack, And even if I put the tool into workspace, It still wont function