How do I make the other part of the script execute after these if statements?
Heres my code:
01 | for _, structureButton in pairs (StructureFrame:GetChildren()) do |
02 | if structureButton:IsA( "TextButton" ) then |
03 | structureButton.MouseButton 1 Up:Connect( function () |
05 | if structureButton.Name = = "WoodWall" then |
06 | if game.Players.LocalPlayer.Materials.Wood.Value > = 5 then |
07 | game.Players.LocalPlayer.Materials.Wood.Value = game.Players.LocalPlayer.Materials.Wood.Value - 5 |
09 | script.Parent.NotEnoughMats.Visible = true |
11 | script.Parent.NotEnoughMats.Visible = false |
15 | if game.Players.LocalPlayer.Materials.Stone.Value > = 5 then |
16 | game.Players.LocalPlayer.Materials.Stone.Value = game.Players.LocalPlayer.Materials.Stone.Value - 5 |
18 | script.Parent.NotEnoughMats.Visible = true |
20 | script.Parent.NotEnoughMats.Visible = false |
26 | script.Parent.Cancel.Visible = true |
27 | StructureFrame.Visible = false |
(Read the -- part of the code)