|
| 1 | +-- change file type to .iy before import! |
| 2 | + |
| 3 | +local isEnabled, isPreloaded = false, false |
| 4 | +local TRIGGERTHRESHOLD = 420 |
| 5 | +local DURATIONTHRESHOLD = 5 |
| 6 | + |
| 7 | +local Plugin = { |
| 8 | + ["PluginName"] = "sigma's edit", |
| 9 | + ["PluginDescription"] = "this is how alpha plays roblox", |
| 10 | + ["Commands"] = { |
| 11 | + ["sigmasedit"] = { |
| 12 | + ["ListName"] = "sigmasedit", |
| 13 | + ["Description"] = "this is how you as an alpha plays roblox?", |
| 14 | + ["Aliases"] = { "sigmaedit" }, |
| 15 | + ["Function"] = function(args, speaker) |
| 16 | + if isEnabled then |
| 17 | + isEnabled = not isEnabled |
| 18 | + notify("sigma's edit", "is " .. (isEnabled and "on" or "off")) |
| 19 | + return |
| 20 | + end |
| 21 | + |
| 22 | + isEnabled = true |
| 23 | + notify("sigma's edit", "enabled! stay frosty me frens (cmd + q if stuck in low framerate)") |
| 24 | + |
| 25 | + local userInputService = game:GetService("UserInputService") |
| 26 | + local contextActionService = game:GetService("ContextActionService") |
| 27 | + local workspace = game:GetService("Workspace") |
| 28 | + local players = game:GetService("Players") |
| 29 | + -- local ContentProvider = game:GetService("ContentProvider") |
| 30 | + |
| 31 | + local equipEvent = contextActionService.LocalToolEquipped |
| 32 | + local unequipEvent = contextActionService.LocalToolUnequipped |
| 33 | + local inputEvent = userInputService.InputBegan |
| 34 | + |
| 35 | + -- personally, i think luau's table is nicer than whatever js is |
| 36 | + local sigmas = { |
| 37 | + ["image"] = { |
| 38 | + 17334028110, |
| 39 | + 15729950259, |
| 40 | + 137892003660281, |
| 41 | + 98357432058989, |
| 42 | + 12552431195, |
| 43 | + 76090971615079, |
| 44 | + 18735477147, |
| 45 | + 15563091890, |
| 46 | + 13497658487, |
| 47 | + 78906920386708, |
| 48 | + 18383312122, |
| 49 | + 18924353209, |
| 50 | + 17337974860, |
| 51 | + 16211045192, |
| 52 | + 13304453336, |
| 53 | + 11393121553, |
| 54 | + 127678838552035, |
| 55 | + 77987465336971, |
| 56 | + 6970682513, |
| 57 | + 99747784406996, |
| 58 | + 10177679701, |
| 59 | + 16740418002, |
| 60 | + 7783359239, |
| 61 | + 18849681057, |
| 62 | + 10009449194, |
| 63 | + 122354736220591, |
| 64 | + 127588103445571, |
| 65 | + 17307559228, |
| 66 | + 5274729037, |
| 67 | + }, |
| 68 | + ["music"] = { -- struct: [id, [point(s) of interest]] |
| 69 | + { 140667339171815, ["duration"] = { 0, 18, 54 } }, |
| 70 | + { 140521045204459, ["duration"] = { 0, 14, 103 } }, |
| 71 | + { 140667339171815, ["duration"] = { 26, 60 } }, |
| 72 | + }, |
| 73 | + } |
| 74 | + |
| 75 | + function preload() |
| 76 | + -- should only call once per init |
| 77 | + if isPreloaded then |
| 78 | + return |
| 79 | + end |
| 80 | + |
| 81 | + -- ContentProvider:PreloadAsync(contents, function(assetId, status) |
| 82 | + -- print(status) |
| 83 | + -- end) |
| 84 | + |
| 85 | + notify("sigma's edit (first time init)", "preloading (may slow a lil bit)") |
| 86 | + local mainContainer = Instance.new("ScreenGui", players.LocalPlayer.PlayerGui) |
| 87 | + local preloadFrame = Instance.new("Frame", mainContainer) |
| 88 | + local preloadImg = Instance.new("ImageLabel") |
| 89 | + local preloadAudio = Instance.new("Sound") |
| 90 | + |
| 91 | + mainContainer.Name = randomString() |
| 92 | + |
| 93 | + preloadFrame.Name = "preloadFrame" |
| 94 | + preloadFrame.Size = UDim2.new(0, 1, 0, 1) |
| 95 | + preloadFrame.BackgroundTransparency = 1 |
| 96 | + |
| 97 | + preloadImg.Name = randomString() |
| 98 | + preloadImg.Parent = preloadFrame |
| 99 | + preloadImg.Size = UDim2.new(0, 1, 0, 1) |
| 100 | + preloadImg.BackgroundTransparency = 1 |
| 101 | + |
| 102 | + preloadAudio.Name = randomString() |
| 103 | + preloadAudio.Parent = preloadFrame |
| 104 | + preloadAudio.Volume = 0.1 |
| 105 | + |
| 106 | + for _, id in ipairs(sigmas["image"]) do |
| 107 | + preloadImg.Image = "rbxassetid://" .. id |
| 108 | + task.wait(0.1) |
| 109 | + end |
| 110 | + for _, entry in ipairs(sigmas["music"]) do |
| 111 | + preloadAudio.SoundId = "rbxassetid://" .. entry[1] |
| 112 | + task.wait(0.1) |
| 113 | + preloadAudio:Play() |
| 114 | + task.wait(0.1) |
| 115 | + preloadAudio:Stop() |
| 116 | + end |
| 117 | + |
| 118 | + mainContainer:Destroy() |
| 119 | + |
| 120 | + isPreloaded = true |
| 121 | + notify("sigma's edit (first time init)", "preloaded!!") |
| 122 | + end |
| 123 | + preload() |
| 124 | + |
| 125 | + local randomPicked = function(type: "image" | "music" | "duration"): number |
| 126 | + if type == "duration" then |
| 127 | + local entry = sigmas["music"][math.random(1, #sigmas["music"])] |
| 128 | + local durations = entry["duration"] |
| 129 | + return durations[math.random(1, #durations)] |
| 130 | + end |
| 131 | + |
| 132 | + if type == "image" then |
| 133 | + return sigmas["image"][math.random(1, #sigmas["image"])] |
| 134 | + end |
| 135 | + |
| 136 | + return sigmas["music"][math.random(1, #sigmas["music"])][1] |
| 137 | + end |
| 138 | + |
| 139 | + local shouldBeTriggered = function(): boolean |
| 140 | + return math.random(1, TRIGGERTHRESHOLD) == 1 |
| 141 | + end |
| 142 | + |
| 143 | + -- local img: ImageLabel = workspace:WaitForChild("d").main.img |
| 144 | + |
| 145 | + local localPlayer = (game:GetService("Players")).LocalPlayer |
| 146 | + local mainContainer = Instance.new("ScreenGui", localPlayer.PlayerGui) |
| 147 | + local imageLabel = Instance.new("ImageLabel", mainContainer) |
| 148 | + local musicPlayer = Instance.new("Sound", mainContainer) |
| 149 | + local fadeOverlay = Instance.new("Frame", mainContainer) |
| 150 | + |
| 151 | + mainContainer.Name = randomString() |
| 152 | + |
| 153 | + imageLabel.Name = randomString() |
| 154 | + imageLabel.AnchorPoint = Vector2.new(0.5, 1) |
| 155 | + imageLabel.Position = UDim2.new(0.5, 0, 0.95, 0) |
| 156 | + imageLabel.Size = UDim2.new(0.2, 0, 0.3, 0) |
| 157 | + imageLabel.ZIndex = 2 |
| 158 | + imageLabel.BorderSizePixel = 0 |
| 159 | + imageLabel.BackgroundTransparency = 1 |
| 160 | + |
| 161 | + fadeOverlay.Name = randomString() |
| 162 | + fadeOverlay.Visible = false |
| 163 | + fadeOverlay.AnchorPoint = Vector2.new(0.5, 0.5) |
| 164 | + fadeOverlay.Position = UDim2.new(0.5, 0, 0.5, 0) |
| 165 | + fadeOverlay.Size = UDim2.new(2, 0, 2, 0) |
| 166 | + fadeOverlay.BackgroundColor3 = Color3.new(119, 119, 119) |
| 167 | + fadeOverlay.BackgroundTransparency = 0.4 |
| 168 | + |
| 169 | + musicPlayer.Name = "sigma_audio" |
| 170 | + musicPlayer.Volume = 0.67 |
| 171 | + musicPlayer.Playing = false |
| 172 | + musicPlayer.Parent = workspace |
| 173 | + |
| 174 | + local fpsCapThread: thread | nil = nil |
| 175 | + function fpsCap(target: number | nil) |
| 176 | + if fpsCapThread then |
| 177 | + task.cancel(fpsCapThread) |
| 178 | + end |
| 179 | + |
| 180 | + if not target then |
| 181 | + fpsCap(math.huge) |
| 182 | + return |
| 183 | + end |
| 184 | + |
| 185 | + local targetFps = math.floor(target) <= 0 and 1 or math.floor(target) |
| 186 | + -- built in setfpscap is... so-so |
| 187 | + -- lets torment cpu |
| 188 | + |
| 189 | + -- if setfpscap and type(setfpscap) == "function" then |
| 190 | + -- setfpscap(targetFps) |
| 191 | + -- else |
| 192 | + |
| 193 | + fpsCapThread = task.spawn(function() |
| 194 | + local timer = os.clock() |
| 195 | + while true do |
| 196 | + if os.clock() >= timer + 1 / targetFps then |
| 197 | + timer = os.clock() |
| 198 | + task.wait() |
| 199 | + end |
| 200 | + end |
| 201 | + end) |
| 202 | + end |
| 203 | + |
| 204 | + local isDebaunce: boolean = false |
| 205 | + local function playRandom() |
| 206 | + if not shouldBeTriggered() or isDebaunce then |
| 207 | + return |
| 208 | + end |
| 209 | + |
| 210 | + isDebaunce = true |
| 211 | + |
| 212 | + -- preloadElement({ |
| 213 | + -- "rbxtextureid://" .. randomPicked("image"), |
| 214 | + -- "rbxassetid://" .. randomPicked("music"), |
| 215 | + -- }) |
| 216 | + |
| 217 | + imageLabel.Image = "rbxassetid://" .. randomPicked("image") |
| 218 | + musicPlayer.SoundId = "rbxassetid://" .. randomPicked("music") |
| 219 | + musicPlayer.TimePosition = randomPicked("duration") |
| 220 | + |
| 221 | + musicPlayer.Playing = true |
| 222 | + fadeOverlay.Visible = true |
| 223 | + imageLabel.Visible = true |
| 224 | + |
| 225 | + -- .1 hangs the whole engine |
| 226 | + -- 1 looks like powerpoint |
| 227 | + task.wait(0.45) |
| 228 | + fpsCap(0.6) |
| 229 | + |
| 230 | + task.delay(DURATIONTHRESHOLD, function() |
| 231 | + fpsCap() |
| 232 | + fadeOverlay.Visible = false |
| 233 | + |
| 234 | + imageLabel.Visible = false |
| 235 | + imageLabel.Image = "" |
| 236 | + |
| 237 | + musicPlayer.Playing = false |
| 238 | + musicPlayer.TimePosition = 0 |
| 239 | + |
| 240 | + isDebaunce = false |
| 241 | + end) |
| 242 | + |
| 243 | + -- print("stopping...") |
| 244 | + end |
| 245 | + |
| 246 | + if isEnabled then |
| 247 | + task.delay(0.5, function() |
| 248 | + equipEvent:Connect(function(_) |
| 249 | + playRandom() |
| 250 | + end) |
| 251 | + |
| 252 | + unequipEvent:Connect(function(_) |
| 253 | + playRandom() |
| 254 | + end) |
| 255 | + |
| 256 | + inputEvent:Connect(function(_, __) |
| 257 | + playRandom() |
| 258 | + end) |
| 259 | + end) |
| 260 | + else |
| 261 | + equipEvent:Disconnect() |
| 262 | + unequipEvent:Disconnect() |
| 263 | + inputEvent:Disconnect() |
| 264 | + end |
| 265 | + end, |
| 266 | + }, |
| 267 | + ["sigmathreshold"] = { |
| 268 | + ["ListName"] = "sigmathreshold [number]", |
| 269 | + ["Description"] = "define the threshold to trigger the sigma's edit (default is " |
| 270 | + .. TRIGGERTHRESHOLD |
| 271 | + .. ") (higher = less frequent)", |
| 272 | + ["Aliases"] = { "sigmaamount" }, |
| 273 | + ["Function"] = function(args, speaker) |
| 274 | + local numArg = tonumber(args[1]) |
| 275 | + if type(numArg) ~= "number" or numArg <= 0 then |
| 276 | + notify( |
| 277 | + "sigma's edit (threshold val err)", |
| 278 | + "expected CORRECT number argument ( n num > 0 , type as 'number')" |
| 279 | + ) |
| 280 | + return |
| 281 | + end |
| 282 | + |
| 283 | + if numArg <= 50 then |
| 284 | + notify("sigma's edit (low threshold val warn)", "might cause significant inconvenience") |
| 285 | + end |
| 286 | + |
| 287 | + TRIGGERTHRESHOLD = numArg or TRIGGERTHRESHOLD |
| 288 | + notify( |
| 289 | + "sigma's edit (threshold changed)", |
| 290 | + "threshold set to " |
| 291 | + .. TRIGGERTHRESHOLD |
| 292 | + .. "." |
| 293 | + .. (TRIGGERTHRESHOLD > 1000 and " (..and okay i can tell that you are mad)" or "") |
| 294 | + ) |
| 295 | + end, |
| 296 | + }, |
| 297 | + -- ["togglesigmasedit"] = { |
| 298 | + -- ["ListName"] = "togglesigmasedit", |
| 299 | + -- ["Description"] = "toggle the sigma's edit", |
| 300 | + -- ["Aliases"] = { "togglesigmaedit" }, |
| 301 | + -- ["Function"] = function(args, speaker) |
| 302 | + -- isEnabled = not isEnabled |
| 303 | + -- notify("sigma's edit", "effect: " .. tostring(isEnabled)) |
| 304 | + -- end, |
| 305 | + -- }, |
| 306 | + }, |
| 307 | +} |
| 308 | + |
| 309 | +return Plugin |
0 commit comments