#The script works only if the battery is in the charachter
2 messages · Page 1 of 1 (latest)
local player = game.Players.LocalPlayer
local batteryName = "Battary"
local backpack = player:WaitForChild("Backpack")
local starterGear = player:FindFirstChild("StarterGear")
local function alreadyHasBattery(excludeTool)
local function check(container)
local tool = container:FindFirstChild(batteryName)
if tool and tool:IsA("Tool") and tool ~= excludeTool then
return true
end
return false
end
if player.Character and check(player.Character) then
return true
end
if backpack and check(backpack) then
return true
end
if starterGear and check(starterGear) then
return true
end
return false
end