Hello ,
I am trying to create a local script that fires an event with some information passed through it. However, I have come across a problem, when I try to get the tool from the backpack I keep getting errors.
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local tool = player:WaitForChild("Backpack"):FindFirstChild("PickAxe")
tool.Activated:Connect(function()
game:GetService("ReplicatedStorage"):WaitForChild("DestroyEvent"):FireServer(mouse.Target, tool)
end)
Just wondered if I am doing anything wrong, any help is appreciated .