Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type announceType = "Basic" | "Warn" | "Alert" | "Epsilon" -- epsilon is basically third trumpet, use it for shutdowns or bans idk
- local module = {}
- local Fusion = require(game:GetService("ReplicatedStorage").Packages.Fusion)
- local peek = Fusion.peek
- local glitch = require(script.GlitchMod)
- local Players = game:GetService("Players")
- local Ranks = {
- [857491600] = "Creator", -- Creare
- [1421532407] = "SuperrCustom", -- Superr_Z
- [510543591] = "Moderator", -- Compec
- [3372922014] = "GabrielCustom", -- Gabriel
- [7073391575] = "Moderator", -- Even
- [424233066] = "Moderator", -- Ruper
- [44327816] = "Moderator", -- Roman
- [4900501306] = "Moderator", -- Watermelon/nonsumme
- [451452431] = "Moderator", -- also watermelon???
- }
- local RankColors = {
- Moderator = Color3.fromHex("#e67e22"),
- Creator = Color3.fromHex("#2ecc71"),
- Unknown = Color3.fromHex("#59156e"),
- SuperrCustom = Color3.fromHex("#db0000"),
- GabrielCustom = Color3.fromHex("#ff08ff"),
- }
- local ExistingState = false
- local timelimit = {}
- local DesignTable = require(script.DesignMod)
- local function merge(tbl1, tbl2)
- local ntbl = {}
- for k, v in pairs(tbl1) do
- ntbl[k] = v
- end
- for k, v in pairs(tbl2) do
- ntbl[k] = v
- end
- return ntbl
- end
- local outsideref = {}
- function module.announce(player: Player, text: string, atype: announceType)
- if not ExistingState then
- local lid = player.UserId
- ExistingState = true
- for _, v in pairs(Players:GetChildren()) do
- task.spawn(function()
- local uid = v.UserId -- UI Creation begins here god forbid these modern ui devs allow for regular ass instances god damn it
- local clonescope = Fusion.scoped({
- Value = Fusion.Value,
- doCleanup = Fusion.doCleanup,
- Tween = Fusion.Tween,
- New = Fusion.New,
- Observer = Fusion.Observer,
- })
- local clonescopetweenable = {
- FrameTransparency = clonescope:Value(1),
- GeneralTransparency = clonescope:Value(1),
- TopCautionPosition = clonescope:Value(UDim2.new(0, 0, 0, 0)),
- BottomCautionPosition = clonescope:Value(UDim2.new(-0.03, 0, 0.9, 0)),
- Volume = clonescope:Value(0.2),
- }
- local clonescopeval = {
- FrameTransparency = clonescope:Tween(
- clonescopetweenable.FrameTransparency,
- TweenInfo.new(1, Enum.EasingStyle.Linear)
- ), -- tween to 0.3
- GeneralTransparency = clonescope:Tween(
- clonescopetweenable.GeneralTransparency,
- TweenInfo.new(1, Enum.EasingStyle.Linear)
- ), -- tween to 0
- CautionSize = clonescope:Value(UDim2.new(5, 0, 0.1, 0)),
- TopCautionPosition = clonescope:Tween(
- clonescopetweenable.TopCautionPosition,
- TweenInfo.new(40, Enum.EasingStyle.Linear)
- ),
- BottomCautionPosition = clonescope:Tween(
- clonescopetweenable.BottomCautionPosition,
- TweenInfo.new(40, Enum.EasingStyle.Linear)
- ),
- Text = clonescope:Value(""),
- Name = clonescope:Value(""),
- NameColor = clonescope:Value(RankColors["Unknown"]),
- Volume = clonescope:Tween(clonescopetweenable.Volume, TweenInfo.new(1, Enum.EasingStyle.Linear)),
- }
- outsideref[uid] = { Text = clonescopeval.Text }
- local _ScreenGui = clonescope:New("ScreenGui")({
- IgnoreGuiInset = true,
- DisplayOrder = 1,
- Parent = v.PlayerGui,
- })
- local _Frame = clonescope:New("Frame")(merge(DesignTable.Frame[atype], {
- BackgroundTransparency = clonescopeval.FrameTransparency,
- Parent = _ScreenGui,
- }))
- local _Trumpet
- if atype ~= "Basic" then
- if atype == "Epsilon" then
- _Trumpet = clonescope:New("Sound")(merge(DesignTable.Trumpet[atype], {
- Parent = _ScreenGui,
- Volume = clonescopeval.Volume,
- }))
- else
- _Trumpet = clonescope:New("Sound")(merge(DesignTable.Trumpet[atype], {
- Parent = _ScreenGui,
- }))
- end
- clonescope:New("ImageLabel")(merge(DesignTable.CautionTop[atype], {
- Parent = _Frame,
- ImageTransparency = clonescopeval.GeneralTransparency,
- Position = clonescopeval.TopCautionPosition,
- Size = clonescopeval.CautionSize,
- }))
- clonescope:New("ImageLabel")(merge(DesignTable.CautionBottom[atype], {
- Parent = _Frame,
- ImageTransparency = clonescopeval.GeneralTransparency,
- Position = clonescopeval.BottomCautionPosition,
- Size = clonescopeval.CautionSize,
- }))
- end
- clonescope:New("TextLabel")(merge(DesignTable.Name, {
- Parent = _Frame,
- Text = clonescopeval.Name,
- TextColor3 = clonescopeval.NameColor,
- TextTransparency = clonescopeval.GeneralTransparency,
- }))
- clonescope:New("TextLabel")(merge(DesignTable.Text[atype], {
- Parent = _Frame,
- Text = clonescopeval.Text,
- TextTransparency = clonescopeval.GeneralTransparency,
- }))
- -- UI Creation ends here
- clonescopetweenable.GeneralTransparency:set(0)
- clonescopetweenable.FrameTransparency:set(0.3)
- if atype ~= "Basic" then
- _Trumpet:Play()
- clonescopetweenable.TopCautionPosition:set(UDim2.new(-4, 0, 0, 0))
- clonescopetweenable.BottomCautionPosition:set(UDim2.new(-(4 - 0.03), 0, 0.9, 0))
- clonescope:Observer(clonescopeval.TopCautionPosition):onChange(function()
- local udim2 = peek(clonescopeval.TopCautionPosition)
- if udim2.X.Scale == -4 then
- clonescopetweenable.TopCautionPosition:set(UDim2.new(0, 0, 0, 0))
- elseif udim2.X.Scale == 0 then
- clonescopetweenable.TopCautionPosition:set(UDim2.new(-4, 0, 0, 0))
- end
- end)
- clonescope:Observer(clonescopeval.BottomCautionPosition):onChange(function()
- local udim2 = peek(clonescopeval.BottomCautionPosition)
- if udim2.X.Scale == -(4 - 0.03) then
- clonescopetweenable.BottomCautionPosition:set(UDim2.new(-0.03, 0, 0.9, 0))
- elseif udim2.X.Scale == -0.03 then
- clonescopetweenable.BottomCautionPosition:set(UDim2.new(-(4 - 0.03), 0, 0, 0))
- end
- end)
- end
- clonescopeval.Name:set(player.Name)
- if Ranks[lid] then
- clonescopeval.NameColor:set(RankColors[Ranks[lid]])
- else
- clonescopeval.NameColor:set(RankColors.Unknown)
- end
- task.wait(1)
- task.spawn(function()
- for i = 1, #text do
- clonescopeval.Text:set(peek(clonescopeval.Text) .. string.sub(text, i, i))
- task.wait(0.09)
- end
- end)
- timelimit[uid] = 10 + math.ceil(#text * 0.09)
- task.spawn(function()
- while timelimit[uid] do
- task.wait(1)
- timelimit[uid] = timelimit[uid] - 1
- if timelimit[uid] <= 0 then
- ExistingState = false
- clonescopetweenable.GeneralTransparency:set(1)
- clonescopetweenable.FrameTransparency:set(1)
- if atype == "Epsilon" then
- clonescopetweenable.Volume:set(0)
- end
- task.wait(1)
- Fusion.doCleanup(clonescope)
- timelimit[uid] = nil
- end
- end
- end)
- end)
- end
- else
- for _, v in pairs(Players:GetChildren()) do
- local uid = v.UserId
- if timelimit[uid] then
- timelimit[uid] = timelimit[uid] + 13
- glitch(peek(outsideref[uid].Text), text, 30, function(str)
- outsideref[uid].Text:set(str)
- end, false, 0.1)
- end
- end
- end
- end
- return module
Advertisement
Add Comment
Please, Sign In to add comment