Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Sungmingamerpro13
- -- Services
- PlayerService = game:GetService('Players')
- TweenService = game:GetService('TweenService')
- -- Variables
- DefaultMessageDelayTime = 4
- LetterInvertal = 0.05
- MessageWaitSigns = {',', '?', '.'}
- MessageWaitSignDelay = 1
- MessageValue = game.ReplicatedStorage.Message
- SpeakerEvent = game.ReplicatedStorage.Message.SpeakerEvent
- ObjectiveEvent = game.ReplicatedStorage.ObjectiveEvent
- HideObjectiveEvent = game.ReplicatedStorage.ObjectiveEvent.HideObjectiveEvent
- TimerEvent = game.ReplicatedStorage.TimerEvent
- HideTimerEvent = game.ReplicatedStorage.TimerEvent.HideTimerEvent
- -- Setup Player Images
- local randomCharacter
- local randomCharacterName
- local function getRandomCharacter()
- local players = PlayerService:GetPlayers()
- repeat
- local number = math.random(1, #players)
- local randomPlayer = players[number]
- randomCharacter = randomPlayer.Character
- until randomCharacter
- randomCharacterName = randomCharacter.Name
- randomCharacter.Archivable = true
- end
- -- Functions
- function BroadcastMessage(Text, MessageDelayTime)
- -- This makes the message appear like a typewriter
- for i = 1,#Text,1 do
- MessageValue.Value = string.sub(Text,1,i)
- for _, L in pairs(MessageWaitSigns) do
- if string.sub(Text,i,i) == L then
- wait(MessageWaitSignDelay)
- end
- end
- wait(LetterInvertal)
- end
- if tonumber(MessageDelayTime) ~= nil then
- wait(MessageDelayTime)
- else
- wait(DefaultMessageDelayTime)
- end
- MessageValue.Value = 'None'
- return true
- end
- function ChangeTime(ToTime, TweenDuration)
- local Lightning = game.Lighting
- local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
- local Tween = TweenService:Create(Lightning, TI, {ClockTime = ToTime})
- Tween:Play()
- end
- function ChangeFogend(ChangeTo, TweenDuration,ColourOrNone)
- if ColourOrNone ~= 'None' then
- game.Lighting.FogColor = ColourOrNone
- end
- local FogendValue = Instance.new('IntValue')
- FogendValue.Value = game.Lighting.FogEnd
- FogendValue:GetPropertyChangedSignal('Value'):Connect(function()
- game.Lighting.FogEnd = FogendValue.Value
- end)
- local TI = TweenInfo.new(TweenDuration,Enum.EasingStyle.Linear)
- local Tween = TweenService:Create(FogendValue, TI, {Value = ChangeTo})
- Tween:Play()
- spawn(function()
- Tween.Completed:Connect(function()
- FogendValue:Destroy()
- end)
- end)
- end
- function teleportPlayers(partCFrame)
- local players = game.Players:getPlayers()
- for _,player in pairs(players) do
- if player.Character then
- if player.Character.HumanoidRootPart.Anchored == false then
- player.Character.Humanoid.Jump = true
- end
- end
- end
- wait(.5)
- for _,player in pairs(players) do
- if player.Character then
- if player.Character.HumanoidRootPart.Anchored == false then
- player.Character:SetPrimaryPartCFrame(partCFrame)
- end
- end
- end
- end
- function SetObjectives(Objective)
- ObjectiveEvent:FireAllClients(Objective)
- end
- function ClearObjectives()
- HideObjectiveEvent:FireAllClients()
- end
- function TopText(Text, Time)
- for i = Time,0,-1 do
- TimerEvent:FireAllClients(Text.." ("..i..")")
- wait(1)
- end
- HideTimerEvent:FireAllClients()
- end
- function TransitionScreen()
- for _, player in pairs(game.Players:GetChildren()) do
- spawn(function()
- local NewGui = game.ServerStorage.Assets.TransitionScreen:Clone()
- NewGui.Parent = player.PlayerGui
- end)
- end
- end
- --- MainScript of Story ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement