local player = game.Players.LocalPlayer local tool = player.Backpack:WaitForChild("Minigun") -- ชื่อ Tool local screenGui = script.Parent local fireButton = screenGui:WaitForChild("FireButton") local heatBar = screenGui:WaitForChild("HeatBar") local firing = false local heat = 0 local maxHeat = 100 -- กดปุ่มยิง fireButton.MouseButton1Down:Connect(function() firing = true while firing do if heat < maxHeat then tool.RemoteEvent:FireServer() heat += 2 heatBar.Size = UDim2.new(heat/maxHeat, 0, 1, 0) end wait(0.05) end end) -- ปล่อยปุ่มหยุดยิง fireButton.MouseButton1Up:Connect(function() firing = false end) -- ลดความร้อน while true do wait(0.1) if heat > 0 then heat -= 1 heatBar.Size = UDim2.new(heat/maxHeat, 0, 1, 0) end end