How do i do so, when it hits 0, the gui will auto disapear.
Gui = script.Parent
WG = game.StarterGui.Health.load
X = Gui.Size
HP = 500
while HP > 0 do
wait()
HP = HP -10
Gui.Size = UDim2.new(0,math.floor(HP),0,25)
print(HP)
end
how to do so when i press the "Dirt" the gui will pop up
local Box = script.Parent --Fortæller hvad vi leder efter
local Grass = Box.grass
local jord = Box.dirt
Box.grass.ClickDetector.MouseClick:connect(function(player)
game.StarterGui.HealthGrass.Screen.Visible = true
jord.Decal1.Texture = "http://www.roblox.com/asset/?id=48336811"
jord.Decal2.Texture = "http://www.roblox.com/asset/?id=48336811"
jord.Decal3.Texture = "http://www.roblox.com/asset/?id=48336811"
jord.Decal4.Texture = "http://www.roblox.com/asset/?id=48336811"
wait(2)
Box:Destroy()
Grass:Destroy()
end)
--Helping notes
Box.dirt.ClickDetector.MouseClick:connect(function(player)
game.StarterGui.HealthGrass.Screen.Visible = true
jord.Decal1.Texture = "http://www.roblox.com/asset/?id=48336811" --This Changes the DECAL FROM HERE
jord.Decal2.Texture = "http://www.roblox.com/asset/?id=48336811"
jord.Decal3.Texture = "http://www.roblox.com/asset/?id=48336811"
jord.Decal4.Texture = "http://www.roblox.com/asset/?id=48336811" -- Stops changeing the DECAL HERE
wait(2) -- Time before the block disapear
Box:Destroy() -- Destroys the block(Dirt)
Grass:Destroy() -- Destroy the block(Grass)
end)

2 comments
sorry still donet know how to force the gui to show in this script
Instead of
game.StarterGui, useplayer.PlayerGuiinside the Grass and Dirt click functions.