Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[SCRIPT THAT IS UNDER FIRE INSTANCE]]--
- NewParent = script.Parent
- repeat
- NewParent = NewParent.Parent
- until NewParent.Name == "House"
- script.Parent.Changed:connect(function()
- if not script.Parent.Enabled then
- NewParent.AlarmBlock.AlarmSound:Stop()
- end
- end)
- --[[MAIN SCRIPT]]--
- wait(1)
- RequireFireFighters = true
- HowMuchFireFighters = 1
- FireTeam = game.Teams["Fire Fighters"]
- MinWaitTime = 5
- MaxWaitTime = 10
- Houses = {}
- --SETUP--
- for _,i in pairs (workspace.Houses:GetChildren()) do table.insert(Houses,i) end
- function SetupA(Object)
- if Object:IsA("Model") then
- for _,i in pairs (Object:GetChildren()) do
- SetupA(i)
- end
- elseif Object:IsA("BasePart") then
- script.Fire:Clone().Parent = Object
- Object:WaitForChild("Fire").Script.Disabled = false
- end
- end
- for _,i in pairs (Houses) do
- SetupA(i)
- script.AlarmSound:Clone().Parent = i.AlarmBlock
- end
- --FUNCTION--
- function SetupB(Object)
- if Object:IsA("Model") then
- for _,i in pairs (Object:GetChildren()) do
- SetupB(i)
- end
- elseif Object:IsA("BasePart") then
- Object.Fire.Enabled = true
- end
- end
- while wait(math.random(MinWaitTime,MaxWaitTime)) do
- local allow = true
- if RequireFireFighters then
- allow = false
- local FireFightersFound = 0
- for _,i in pairs (game.Players:GetPlayers()) do
- if i.Team == FireTeam then
- FireFightersFound = FireFightersFound + 1
- end
- end
- wait()
- if FireFightersFound >= HowMuchFireFighters then
- allow = true
- end
- end
- if allow then
- local Choice = math.random(1,#Houses)
- for _,i in pairs (Houses[Choice]:GetChildren()) do
- SetupB(i)
- end
- Houses[Choice].AlarmBlock.AlarmSound:Play()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement