Advertisement
Sungmingamerpro13

MainScript 2

Aug 16th, 2022
162
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 1 0
  1. -- Sungmingamerpro13
  2.  
  3. -- Services
  4. PlayerService = game:GetService('Players')
  5. TweenService = game:GetService('TweenService')
  6.  
  7. local BroadCastMessageEvent = game.ReplicatedStorage.DialogueRemotes.BroadCastMessage
  8. local SetMessageSpeakerEvent = game.ReplicatedStorage.DialogueRemotes.SetMessageSpeaker
  9. local HideMessageSpeakerEvent = game.ReplicatedStorage.DialogueRemotes.HideMessageSpeaker
  10.  
  11. -- Other Useful Functions
  12. DefaultMessageDelayTime = 4
  13. MessageWaitSigns = {',', '?', '.'}
  14.  
  15. local randomPlayer
  16. local randomPlayerName
  17. local randomPlayerId
  18.  
  19. local function getPlayerImage(player_id)
  20. local content, isReady = game:GetService("Players"):GetUserThumbnailAsync(player_id, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size420x420)
  21. return content
  22. end
  23.  
  24. local function getRandomPlayer()
  25. local players = game.Players:getPlayers()
  26. local number = math.random(1,#players)
  27. local randomPlayer = players[number]
  28. randomPlayerName = randomPlayer.Name
  29. randomPlayerId = randomPlayer.UserId
  30. end
  31.  
  32. function ChangeTime(ToTime, TweenDuration)
  33. local Lightning = game.Lighting
  34. local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
  35. local Tween = TweenService:Create(Lightning, TI, {ClockTime = ToTime})
  36. Tween:Play()
  37. end
  38.  
  39. function ChangeFogend(ChangeTo, TweenDuration,ColourOrNone)
  40. if ColourOrNone ~= 'None' then
  41. game.Lighting.FogColor = ColourOrNone
  42. end
  43. local FogendValue = Instance.new('IntValue')
  44. FogendValue.Value = game.Lighting.FogEnd
  45. FogendValue:GetPropertyChangedSignal('Value'):Connect(function()
  46. game.Lighting.FogEnd = FogendValue.Value
  47. end)
  48. local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
  49. local Tween = TweenService:Create(FogendValue, TI, {Value = ChangeTo})
  50. Tween:Play()
  51. spawn(function()
  52. Tween.Completed:Connect(function()
  53. FogendValue:Destroy()
  54. end)
  55. end)
  56. end
  57.  
  58. function Teleport(TeleportPosition)
  59. for i, players in pairs(game.Players:GetChildren()) do
  60. players.Character:FindFirstChild("HumanoidRootPart").CFrame = TeleportPosition
  61. end
  62. end
  63.  
  64. function BroadCastMessage(Text, MessageDelayTime)
  65. for i = 1,#Text,1 do
  66. BroadCastMessageEvent:FireAllClients(string.sub(Text,1,i))
  67. for _, L in pairs(MessageWaitSigns) do
  68. if string.sub(Text,i,i) == L then
  69.  
  70. end
  71. end
  72. end
  73. if tonumber(MessageDelayTime) ~= nil then
  74. wait(MessageDelayTime)
  75. else
  76. wait(DefaultMessageDelayTime)
  77. end
  78. HideMessageSpeakerEvent:FireAllClients()
  79. return true
  80. end
  81.  
  82. function SetMessageSpeaker(Name, Image)
  83. SetMessageSpeakerEvent:FireAllClients(Name, Image)
  84. end
  85.  
  86. -- NPCS --
  87.  
  88. local Leader_Image = "rbxassetid://10602727357"
  89. local NPC_Image = "rbxassetid://"
  90. local Monster_Image = "rbxassetid://"
  91.  
  92. -- MainScript --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement