Hello i want my gui to display how many bombs are left And it wont check if the number of bombs wich is an int value is 0 can i please have some help i dont know how to fix this
local button = script.Parent
local ExplosionOutOfBarrel = script.Parent.Parent.Partofexplode.Explosion
local ExplosionSoundOutofThebarrel = script.Parent.Parent.Partofexplode.ExplosionSound
local ExplodsionLight = script.Parent.Parent.Partofexplode.ExplosionLight
local SmokeyBoi = script.Parent.Parent.Partofexplode.Smoke
local AmountOfBombsleft = script.Parent.AmountOfBombs
local GuiOfBombs = game.StarterGui.ScreenGui.ShowBombs
local Xplode1 = script.Parent.Parent.ExplosionPart1.Explosion1
local Xplode2 = script.Parent.Parent.ExplosionPart2.Explosion2
local PartThatOofs = script.Parent.Parent.PartThatGoesBoom
local function BombGoOff()
button.BrickColor = BrickColor.new("Really red")
button.ClickDetector.MaxActivationDistance = 0
ExplosionSoundOutofThebarrel:Play()
Xplode1.Visible = true
PartThatOofs.Transparency = 1
PartThatOofs.CanCollide = false
AmountOfBombsleft.Value = AmountOfBombsleft.Value - 1
SmokeyBoi.Enabled = true
ExplosionOutOfBarrel.Visible = true
ExplodsionLight.Brightness = 7
wait(0.78)
ExplodsionLight = 0
wait(15)
SmokeyBoi.Enabled = false
PartThatOofs.Transparency = 0
PartThatOofs.CanCollide = true
wait(1)
button.BrickColor = BrickColor.new("Shamrock")
button.ClickDetector.MaxActivationDistance = 32
GuiOfBombs.Text = "".. AmountOfBombsleft.. "Bombs left!"
end
local function MakeSureItisntBelow()
if AmountOfBombsleft.Value ~= 1 then
game.Players:ClearAllChildren()
AmountOfBombsleft.Text = "No More Bombs Left. Join a Different server"
end
end
script.Parent.ClickDetector.MouseClick:Connect(function()
BombGoOff()
MakeSureItisntBelow()
end)
while true do
MakeSureItisntBelow()
end
this script is in a part wich is the button
