Advertisement
Sungmingamerpro13

MainScript 4

May 7th, 2024
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.73 KB | None | 0 0
  1. local CreateDialogueEvent = game.ReplicatedStorage.CreateDialogueEvent
  2. local HideDialogueEvent = game.ReplicatedStorage.CreateDialogueEvent.HideDialogueEvent
  3. local TopTextValue = game.ReplicatedStorage.TopText
  4. local ObjectiveValue = game.ReplicatedStorage.TopText.Objective
  5. local ItemsFound = game.ReplicatedStorage.ItemsFound
  6.  
  7. -- Other Useful Functions
  8.  
  9. local randomPlayer
  10. local randomPlayerName
  11. local randomPlayerId
  12.  
  13. local function getPlayerImage(player_id)
  14.     local content, isReady = game:GetService("Players"):GetUserThumbnailAsync(player_id, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
  15.     return content
  16. end
  17.  
  18. local function getRandomPlayer()
  19.     local players = game.Players:getPlayers()
  20.     local number = math.random(1,#players)
  21.     randomPlayer = players[number]
  22.     randomPlayerName = randomPlayer.Name
  23.     randomPlayerId = randomPlayer.UserId
  24. end
  25.  
  26. function BroadCastMessage(name, Id, Message)
  27.     CreateDialogueEvent:FireAllClients(name, Id, Message)
  28. end
  29.  
  30. function HideCastMessage()
  31.     HideDialogueEvent:FireAllClients()
  32. end
  33.  
  34. function TopText(Text, Time)
  35.     for i = Time, 0, -1 do
  36.         TopTextValue.Value = Text.."("..i..")"
  37.         wait(1)
  38.     end
  39.     TopTextValue.Value = "None"
  40. end
  41.  
  42. function SetObjectives(Objective)
  43.     ObjectiveValue.Value = Objective
  44. end
  45.  
  46. function ClearObjectives()
  47.     ObjectiveValue.Value = "None"
  48. end
  49.  
  50. function SetItemsFound(Text)
  51.     ItemsFound.Value = Text
  52. end
  53.  
  54. function ClearItemsFound()
  55.     ItemsFound.Value = "None"
  56. end
  57.  
  58. --- NPCImages ---
  59.  
  60. local NPC_Image = "rbxassetid://16918435393"
  61. local NPC_Angry = "rbxassetid://17421682251"
  62. local NPC_Sad = "rbxassetid://17047446364"
  63. local NPC_Image2 = "rbxassetid://17047444939"
  64. local Monster_Image = "rbxassetid://17022795013"
  65.  
  66. ---- MainScript of Story ----
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement