Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Sungmingamerpro13
- -- Services
- PlayerService = game:GetService('Players')
- TweenService = game:GetService('TweenService')
- local BroadCastMessageEvent = game.ReplicatedStorage.DialogueRemotes.BroadCastMessage
- local SetMessageSpeakerEvent = game.ReplicatedStorage.DialogueRemotes.SetMessageSpeaker
- local HideMessageSpeakerEvent = game.ReplicatedStorage.DialogueRemotes.HideMessageSpeaker
- -- Other Useful Functions
- DefaultMessageDelayTime = 4
- MessageWaitSigns = {',', '?', '.'}
- local randomPlayer
- local randomPlayerName
- local randomPlayerId
- local function getPlayerImage(player_id)
- local content, isReady = game:GetService("Players"):GetUserThumbnailAsync(player_id, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size420x420)
- return content
- end
- local function getRandomPlayer()
- local players = game.Players:getPlayers()
- local number = math.random(1,#players)
- local randomPlayer = players[number]
- randomPlayerName = randomPlayer.Name
- randomPlayerId = randomPlayer.UserId
- 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 Teleport(TeleportPosition)
- for i, players in pairs(game.Players:GetChildren()) do
- players.Character:FindFirstChild("HumanoidRootPart").CFrame = TeleportPosition
- end
- end
- function BroadCastMessage(Text, MessageDelayTime)
- for i = 1,#Text,1 do
- BroadCastMessageEvent:FireAllClients(string.sub(Text,1,i))
- for _, L in pairs(MessageWaitSigns) do
- if string.sub(Text,i,i) == L then
- end
- end
- end
- if tonumber(MessageDelayTime) ~= nil then
- wait(MessageDelayTime)
- else
- wait(DefaultMessageDelayTime)
- end
- HideMessageSpeakerEvent:FireAllClients()
- return true
- end
- function SetMessageSpeaker(Name, Image)
- SetMessageSpeakerEvent:FireAllClients(Name, Image)
- end
- -- NPCS --
- local Leader_Image = "rbxassetid://10602727357"
- local NPC_Image = "rbxassetid://"
- local Monster_Image = "rbxassetid://"
- -- MainScript --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement