I want to make this tool detection script refresh after 30-60 seconds but i don’t know how to do this, while true do din’t worked
local toolName = “PFoodCan”
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.Backpack:FindFirstChild(toolName) then
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolPFood.Text = "Purchased"
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolPFood.GiveTool:Remove()
print("foodCan found")
else
print("foodCan not found")
end
end)
end)
local toolName2 = "WaterBucket"
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.Backpack:FindFirstChild(toolName2) then
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolWBucket.Text = "Purchased"
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolWBucket.GiveTool:Remove()
print("WaterBucket found")
else
print("WaterBucket not found")
end
end)
end)
local toolName3 = "SilverCoin"
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.Backpack:FindFirstChild(toolName3) then
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolSilverCoin.Text = "Purchased"
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolSilverCoin.GiveTool:Remove()
print("SilverCoin found")
else
print("SilverCoin not found")
end
end)
end)
local toolName4 = "GoldCoin"
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.Backpack:FindFirstChild(toolName4) then
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolGoldCoin.Text = "Purchased"
Player.PlayerGui:WaitForChild("Shop").Frame.GiveToolGoldCoin.GiveTool:Remove()
print("GoldCoin found")
else
print("GoldCoin not found")
end
end)
end)