CCCPaste

MainScript 5 (STORY GAME)

local DialogueEvent = game.ReplicatedStorage.Remotes.DialogueEvent
local HideDialogueEvent = game.ReplicatedStorage.Remotes.HideDialogueEvent
local TopTextValue = game.ReplicatedStorage.TopText
local ObjectiveValue = game.ReplicatedStorage.TopText.Objective
local ItemsFound = game.ReplicatedStorage.ItemsFound

local randomPlayer

function BroadCastMessage(character, Text)
	DialogueEvent:FireAllClients(character, Text)
end

function HideCastMessage()
	HideDialogueEvent:FireAllClients()
end

function TopText(Text, Time)
	for i = Time, 0, -1 do
		TopTextValue.Value = Text.."("..i..")"
		wait(1)
	end
	TopTextValue.Value = "None"
end

function SetObjectives(Objective)
	ObjectiveValue.Value = Objective
end

function ClearObjectives()
	ObjectiveValue.Value = "None"
end

function SetItemsFound(Text)
	ItemsFound.Value = Text
end

function ClearItemsFound()
	ItemsFound.Value = "None"
end

function ChooseRandomPlayer()
	return game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())]
end

function MoveNPC(NPCName, Location)
	local NPC = workspace[NPCName]
	NPC.Humanoid:MoveTo(Location.Position)
	NPC.Humanoid.MoveToFinished:Wait()
end

function FaceNPC(NPCName, FaceID)
	local NPC = workspace[NPCName]
	NPC.Head.face.Texture = "rbxassetid://"..FaceID
end

function TransitionScreen()
	for _, player in pairs(game.Players:GetPlayers()) do
		spawn(function()
			local NewGui = game.ServerStorage.Assets.TransitionScreen:Clone()
			NewGui.Parent = player.PlayerGui
		end)
	end
end

---- NPC Face ----

local Happy = "20722053"
local Angry = "14163753887"
local Sad = "17156406277"
local Scared = "4468478419"
local Crying = "7217996242"

---- NPC ----

local NPC = workspace["Sungmin"]

---- MainScript ----