Hello i need some help my gui wont change and the script is basicly not working
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 <= 0 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

2 comments
you should keep line 3 as one string
your code in general is junky and super messy, no wonder it won't do anything. Re-write it.