Skip to content

Instantly share code, notes, and snippets.

@tumen102
Created July 17, 2022 21:36
Show Gist options
  • Save tumen102/e732a86233d517659aa00f5cbe0a71b1 to your computer and use it in GitHub Desktop.
Save tumen102/e732a86233d517659aa00f5cbe0a71b1 to your computer and use it in GitHub Desktop.
Arsenal Cosmetic Mod GUI (open source)
print("Initializing GUI")
local sizeX = 250
local sizeY = 200
local posX = 3
local posY = 250
local title = "workspace"
local version = "0.1_cosmetic"
local notifSound = Instance.new("Sound", workspace)
notifSound.SoundId = "rbxassetid://7853210274"
function notify(notifTitle, notifText, notifDuration)
game:GetService("StarterGui"):SetCore("SendNotification", {
Title=notifTitle or Title,
Text=notifText or "Hello, world!",
Duration=notifDuration or 2
})
notifSound:Play()
end
local pageOpen = "home"
local p = game.Players.LocalPlayer
local cg = game:GetService("CoreGui")
if(cg:FindFirstChild("c2NyaXB0IGh1Yg") ~= nil) then
notify("Error", title.." is already running!", 5)
return
end
local Gui = Instance.new("ScreenGui", cg)
Gui.Name = "c2NyaXB0IGh1Yg"
local Frame = Instance.new("Frame", Gui)
Frame.AnchorPoint = Vector2.new(0,1)
Frame.Size = UDim2.new(0,sizeX,0,sizeY)
Frame.Position = UDim2.new(0,posX,0,posY)
Frame.Position = UDim2.new(0,0,1,0)
Frame.BorderSizePixel = 3
Frame.BorderColor3 = Color3.fromRGB(60, 60, 60)
Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
local TitleText = Instance.new("TextLabel", Frame)
TitleText.Text = title
TitleText.Size = UDim2.new(0,sizeX-10,0,15)
TitleText.Position = UDim2.new(0,5,0,0)
TitleText.TextColor3 = Color3.new(1, 1, 1)
TitleText.TextScaled = true
TitleText.BackgroundTransparency = 1
TitleText.TextXAlignment = 0
TitleText.Font = Enum.Font.Code
local VersionText = Instance.new("TextLabel", Frame)
VersionText.Text = "v"..version
VersionText.Size = UDim2.new(0,sizeX-10,0,15)
VersionText.Position = UDim2.new(0,5,0,0)
VersionText.TextColor3 = Color3.new(1, 1, 1)
VersionText.TextScaled = true
VersionText.BackgroundTransparency = 1
VersionText.TextXAlignment = 1
VersionText.Font = Enum.Font.Code
local ScriptList = Instance.new("ScrollingFrame", Frame)
ScriptList.Position = UDim2.new(0,0,0,20)
ScriptList.Size = UDim2.new(0,sizeX,0,sizeY-20)
ScriptList.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
ScriptList.BorderSizePixel = 0
ScriptList.ScrollBarThickness = 4
ScriptList.TopImage = "BottomImage"
ScriptList.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
local ListLayout = Instance.new("UIListLayout", ScriptList)
local hookedevents = {}
local scriptPages = {}
function addScript(pageid, name, func, dontinsert)
local newscript = Instance.new("TextButton", ScriptList)
newscript.Size = UDim2.new(0,sizeX-10,0,20)
newscript.Position = UDim2.new(0,5,0,0)
newscript.TextColor3 = Color3.new(1,1,1)
newscript.BackgroundColor3 = Color3.fromRGB(45,45,45)
newscript.BackgroundTransparency = 1
newscript.BorderSizePixel = 0
newscript.TextXAlignment = 0
newscript.Text = " "..name
newscript.TextScaled = false
newscript.Font = Enum.Font.Legacy
if(dontinsert ~= true) then
if(scriptPages[pageid] == nil) then
scriptPages[pageid] = {}
scriptPages[pageid][name] = {}
table.insert(scriptPages[pageid][name], func)
table.insert(scriptPages[pageid][name], name)
--table.insert(scriptPages[pageid], name=func)
else
scriptPages[pageid][name] = {}
table.insert(scriptPages[pageid][name], func)
table.insert(scriptPages[pageid][name], name)
--table.insert(scriptPages[pageid], func)
end
end
table.insert(hookedevents, newscript.MouseButton1Click:connect(function () pcall(function() func() end) end))
end
function restoreScripts(pageid)
if(scriptPages[pageid] ~= nil) then
for i,v in ipairs(scriptPages[pageid]) do
local fun
local nam
for a, b in pairs(v) do
if(tostring(type(b)) == "function") then
fun = function ()
b()
end
else
nam = b
end
--print(nam.." "..tostring(fun))
end
addScript(nil, nam, fun, true)
--print(nam.." "..tostring(fun))
end
else
notify(title, "Table doesn't exist! PageID: "..tostring(scriptPages[pageid]))
end
end
function clearScripts()
for i,v in pairs(ScriptList:GetChildren()) do
if(v:IsA("TextButton")) then v:Destroy() end
end
end
notify(title, "Gui & Functions Loaded", 1)
addScript("home", "> unload", function()
Gui:Destroy()
notifSound:Destroy()
end)
addScript("home", "enable rainbow gun", function()
getgenv().rainbowgun = true
notify(title, "rainbowsssss", 2)
getgenv().rainbow = 0
coroutine.resume(coroutine.create(function ()
while(getgenv().rainbowgun == true) do
wait()
pcall( function ()
for i,v in pairs(workspace.Camera.Arms:GetDescendants()) do
if(v:IsA("MeshPart")) then
v.Color = Color3.fromHSV(math.acos(math.cos(getgenv().rainbow * math.pi)) / math.pi,0.4,1)
v.Material = Enum.Material.SmoothPlastic
getgenv().rainbow = getgenv().rainbow + 0.001
end
end
end )
end
end))
end)
addScript("home", "disable rainbow gun", function()
getgenv().rainbowgun = false
notify(title, "switch weapon to reset colours n textures", 2)
end)
addScript("home", "enable no gun animations", function()
notify(title, "haha gun go ......................", 2)
getgenv().noanim = true
coroutine.resume(coroutine.create(function ()
while(getgenv().noanim == true) do
wait()
pcall( function ()
for i,v in pairs(workspace.Camera.Arms:GetDescendants()) do
if(v:IsA("Animation") or v:IsA("AnimationController")) then
v:Destroy()
end
end
end )
end
end))
end)
addScript("home", "disable no gun animations", function()
getgenv().noanim = false
notify(title, "switch weapon to respawn animations", 2)
end)
addScript("home", "enable no arms", function()
getgenv().noarms = true
notify(title, "chopped off your arms!", 2)
coroutine.resume(coroutine.create(function ()
while(getgenv().noarms == true) do
wait()
pcall( function ()
for i,v in pairs(workspace.Camera.Arms.CSSArms:GetDescendants()) do
v:Destroy()
end
end )
end
end))
end)
addScript("home", "disable no arms", function()
notify(title, "switch weapon to revive your arms", 2)
getgenv().noarms = false
end)
addScript("home", "set map to night", function()
notify(title, "setting clocktime to 0", 2)
game:GetService("Lighting").ClockTime = 0
end)
addScript("home", "set map to day", function()
notify(title, "setting clocktime to 14", 2)
game:GetService("Lighting").ClockTime = 14
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment