Advertisement
Sungmingamerpro13

New MainScript Update (SungExetior13RBLX Style)

Nov 15th, 2024
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.80 KB | None | 0 0
  1. --- Sungmingamerpro13
  2.  
  3. -- Services
  4. PlayerService = game:GetService('Players')
  5. TweenService = game:GetService('TweenService')
  6.  
  7. -- Variables
  8. DefaultMessageDelayTime = 4
  9. LetterInvertal = 0.05
  10. MessageWaitSigns = {',', '?', '.'}
  11. MessageWaitSignDelay = 1
  12.  
  13. MessageValue = game.ReplicatedStorage.Message
  14. ImageValue = game.ReplicatedStorage.Message.SpeakerImage
  15. SpeakerValue = game.ReplicatedStorage.Message.SpeakerName
  16. HideDialogueEvent = game.ReplicatedStorage.Message.HideDialogueEvent
  17.  
  18. -- randomPlayer or NPC
  19.  
  20. local randomPlayer
  21.  
  22. -- Functions
  23.  
  24. function BroadCastMessage(Text, MessageDelayTime)
  25.     for i = 1,#Text,1 do
  26.         MessageValue.Value = string.sub(Text,1,i)
  27.         for _, L in pairs(MessageWaitSigns) do
  28.             if string.sub(Text,i,i) == L then
  29.                 wait(MessageWaitSignDelay)
  30.             end
  31.         end
  32.         wait(LetterInvertal)
  33.     end
  34.     if tonumber(MessageDelayTime) ~= nil then
  35.         wait(MessageDelayTime)
  36.     else
  37.         wait(DefaultMessageDelayTime)
  38.     end
  39. end
  40.  
  41. function HideCastMessage()
  42.     HideDialogueEvent:FireAllClients()
  43. end
  44.  
  45. function SetMessageSpeaker(Name, Model)
  46.     if Name == randomPlayer then
  47.         randomPlayer = game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())]
  48.         Name = randomPlayer.Name
  49.     end
  50.     ImageValue.Value = Name or Model
  51.     SpeakerValue.Value = Name
  52. end
  53.  
  54. function ChangeTime(ToTime, TweenDuration)
  55.     local Lightning = game.Lighting
  56.     local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
  57.     local Tween = TweenService:Create(Lightning, TI, {ClockTime = ToTime})
  58.     Tween:Play()
  59. end
  60.  
  61. function ChangeFogend(ChangeTo, TweenDuration,ColourOrNone)
  62.     if ColourOrNone ~= 'None' then
  63.         game.Lighting.FogColor = ColourOrNone
  64.     end
  65.     local FogendValue = Instance.new('IntValue')
  66.     FogendValue.Value = game.Lighting.FogEnd
  67.     FogendValue:GetPropertyChangedSignal('Value'):Connect(function()
  68.         game.Lighting.FogEnd = FogendValue.Value
  69.     end)
  70.     local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
  71.     local Tween = TweenService:Create(FogendValue, TI, {Value = ChangeTo})
  72.     Tween:Play()
  73.     spawn(function()
  74.         Tween.Completed:Connect(function()
  75.             FogendValue:Destroy()
  76.         end)
  77.     end)
  78. end
  79.  
  80. function teleportPlayers(partCFrame)
  81.     local players = game.Players:getPlayers()
  82.     for _,player in pairs(players) do
  83.         if player.Character then
  84.             if player.Character.HumanoidRootPart.Anchored == false then
  85.                 player.Character.Humanoid.Jump = true
  86.             end
  87.         end
  88.     end
  89.     wait(.5)
  90.     for _,player in pairs(players) do
  91.         if player.Character then
  92.             if player.Character.HumanoidRootPart.Anchored == false then
  93.                 player.Character:SetPrimaryPartCFrame(partCFrame)
  94.             end
  95.         end
  96.     end
  97. end
  98.  
  99. function TransitionScreen()
  100.     for _, player in pairs(game.Players:GetPlayers()) do
  101.         spawn(function()
  102.             local NewGui = game.ServerStorage.Assets.TransitionScreen:Clone()
  103.             NewGui.Parent = player.PlayerGui
  104.         end)
  105.     end
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement