local n=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local I=game.Workspace.Blue I.Parent=nil local X=require(script.Dinosaur)local r=n.AddToPopperCamIgnore local function t()local n=I:Clone()n.Parent=game.Workspace local u=X.new(n)r:FireAllClients(n,true)n.Body.Humanoid.Died:Connect(function()r:FireAllClients(n,false)t()end)end t()
--[[
	This script handles all behavior for the dinosaur Blue in the Jurassic World Creator Challenge.	
	
	Note:
	With this script detached from the dinosaur-model, we can easily manage more dinosaurs at once! (How cool isn't that..?!)
	This script can also be moved into the Dinosaur if preferred. Just make sure to swap out "workspace:WaitForChild("Blue")" with
	script.Parent or similar. The target path should be the root model currently named "Blue" which contains a model named "Body".
--]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local DinosaurModelTemplate = game.Workspace.Blue
DinosaurModelTemplate.Parent = nil
local Dinosaur = require(script.Dinosaur)

local AddToPopperCamIgnore = ReplicatedStorage.AddToPopperCamIgnore

local function spawnDinosaur()
	local DinosaurModel = DinosaurModelTemplate:Clone()
	DinosaurModel.Parent = game.Workspace
	local DinosaurAI = Dinosaur.new(DinosaurModel)
	AddToPopperCamIgnore:FireAllClients(DinosaurModel, true)

	DinosaurModel.Body.Humanoid.Died:Connect(function()
		AddToPopperCamIgnore:FireAllClients(DinosaurModel, false)
		spawnDinosaur()
	end)
end

spawnDinosaur()
