I was wondering how i would go about making a script to wait until a tool is in my player.Character
I have already tried using .Equipped, but that makes the function fire when the tool is in his inventory, i want to check if the player has the tool in his hands
You could do this which is more reliable. Add this into a local script. Then move the local script into starter gui(if u don’t then this wont work.)
local Character = game.Players.LocalPlayer.Character
Character.ChildAdded:Connect(function(Child)
if Child:IsA("Tool") then
if Child.Name == "ToolNameHere" then
--- do stuff
end
end
end)
This will check every time a child is added. So it’ll check if it is a tool. Then it will check if it’s your desired tool name. Then you can make it do the stuff.
local players = game:GetService("Players")
player.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local backpack = player:WaitForChild("Backpack")
local tools = backpack:GetChildren()
for i, tool in pairs(tools) do
tool.Equipped:Connect(function(mouse)
--do stuff here
end)
end
end)
end)