RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make it do the 'main' function when tick starttime is == 5"
local boolValue = script.Parent.Start repeat task.wait(1) until boolValue.Value == true local model = script.Parent local sound = script.Parent.Proppppp.Fly local startTime = tick() local TweenService = game:GetService("TweenService") local function main() local folder = game.Workspace.enemies local children = folder:GetChildren() for i = 1, math.min(100, #children) do local child = children[i] local zombie = child:FindFirstChildOfClass("Humanoid") if zombie then zombie.Health = 0 end end end local function sizeout() for _, child in pairs(script.Parent:GetChildren()) do if child and child:IsA('MeshPart') or child:IsA('BasePart') then local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local goal = {Size = Vector3.new(0, 0, 0)} local tween = TweenService:Create(child, tweenInfo, goal) tween:Play() end end end local function fadeOutSound() local volume = sound.Volume while volume > 0 do volume = volume - 0.1 sound.Volume = volume task.wait(0.1) end sound:Stop() end local function done() print("Air Support finished") sizeout() fadeOutSound() task.wait(5) model:Destroy() end while tick() - startTime <= 5 do model:PivotTo(CFrame.new(model:GetPivot().Position - Vector3.new(0, 0, 7.5))) task.wait() if tick() - startTime == 5 then main() end end done()