Advertisement
Sungmingamerpro13

MainScript 5 (STORY GAME)

May 15th, 2024 (edited)
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.76 KB | None | 0 0
  1. local DialogueEvent = game.ReplicatedStorage.Remotes.DialogueEvent
  2. local HideDialogueEvent = game.ReplicatedStorage.Remotes.HideDialogueEvent
  3. local TopTextValue = game.ReplicatedStorage.TopText
  4. local ObjectiveValue = game.ReplicatedStorage.TopText.Objective
  5. local ItemsFound = game.ReplicatedStorage.ItemsFound
  6.  
  7. local randomPlayer
  8.  
  9. function BroadCastMessage(character, Text)
  10.     DialogueEvent:FireAllClients(character, Text)
  11. end
  12.  
  13. function HideCastMessage()
  14.     HideDialogueEvent:FireAllClients()
  15. end
  16.  
  17. function TopText(Text, Time)
  18.     for i = Time, 0, -1 do
  19.         TopTextValue.Value = Text.."("..i..")"
  20.         wait(1)
  21.     end
  22.     TopTextValue.Value = "None"
  23. end
  24.  
  25. function SetObjectives(Objective)
  26.     ObjectiveValue.Value = Objective
  27. end
  28.  
  29. function ClearObjectives()
  30.     ObjectiveValue.Value = "None"
  31. end
  32.  
  33. function SetItemsFound(Text)
  34.     ItemsFound.Value = Text
  35. end
  36.  
  37. function ClearItemsFound()
  38.     ItemsFound.Value = "None"
  39. end
  40.  
  41. function ChooseRandomPlayer()
  42.     return game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())]
  43. end
  44.  
  45. function MoveNPC(NPCName, Location)
  46.     local NPC = workspace[NPCName]
  47.     NPC.Humanoid:MoveTo(Location.Position)
  48.     NPC.Humanoid.MoveToFinished:Wait()
  49. end
  50.  
  51. function FaceNPC(NPCName, FaceID)
  52.     local NPC = workspace[NPCName]
  53.     NPC.Head.face.Texture = "rbxassetid://"..FaceID
  54. end
  55.  
  56. function TransitionScreen()
  57.     for _, player in pairs(game.Players:GetPlayers()) do
  58.         spawn(function()
  59.             local NewGui = game.ServerStorage.Assets.TransitionScreen:Clone()
  60.             NewGui.Parent = player.PlayerGui
  61.         end)
  62.     end
  63. end
  64.  
  65. ---- NPC Face ----
  66.  
  67. local Happy = "20722053"
  68. local Angry = "14163753887"
  69. local Sad = "17156406277"
  70. local Scared = "4468478419"
  71. local Crying = "7217996242"
  72.  
  73. ---- NPC ----
  74.  
  75. local NPC = workspace["Sungmin"]
  76.  
  77. ---- MainScript ----
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement