Advertisement
ceater_nerd

Become Fumo Script Panel

May 5th, 2021 (edited)
2,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.96 KB | None | 0 0
  1. --[[
  2. ceat_ceat
  3. become fumo script panel
  4.  
  5. -----------------------------------------
  6.  
  7. new script panel here:
  8. https://github.com/ceat-ceat/ScriptPanelv2/blob/main/scriptpanelv2.lua
  9.  
  10. this old version will no longer be updated, please use the one above for new projects!!! unless you wanna use this old one then go ahead i cant stop you jgbsd fasdfsdahfn hgv nasfdsf
  11.  
  12. -----------------------------------------
  13.  
  14. this panel script is made for become fumo but id imagine you can use it for other scripts too
  15.  
  16. how to use:
  17. run the script with httpget or whatever
  18.  
  19. sample code -----------------------------------------
  20.  
  21. local new = _G.becomefumopanel:AddScript("lol")
  22. new:AddProperty("fat","String").PropertyChanged:Connect(function(value)
  23.     print(value)
  24. end)
  25. _G.becomefumopanel:RemoveScript("lol")
  26.  
  27. --------------------------
  28.  
  29. _G.becomefumopanel:AddScript(name)
  30.     - name is a string parameter, returns an add property function
  31.  
  32. :AddProperty(name,type,default)
  33.     - a function you use that is returns by the function above
  34.     - adds a property the player can set to the panel
  35.     - name is the property name, type is the property type, and default is the default value
  36.     property types:
  37.     - Boolean
  38.     - Number
  39.     - String
  40.     this function returns a PropertyChanged event which passed the new value of the property and a Value property for direct property grabbing
  41.  
  42. _G.becomefumopanel:RemoveScript(name)
  43.     - name is a string parameter, removes a script with the name given
  44.    
  45. 5/7/2021 changes:
  46. - the addproperty function now also returns a value property
  47. 6/9/2021 changes:
  48. - added _G.becomefumopanel:RemoveScript() to documentation
  49.  
  50. ]]
  51.  
  52. local ts = game:GetService("TweenService")
  53. function create(class,prop)
  54.     local inst = Instance.new(class)
  55.     if prop then
  56.         for i, v in next, prop do
  57.             inst[i] = v
  58.         end
  59.     end
  60.     return inst
  61. end
  62. function tween(inst,prop,dur,dir,eas)
  63.     ts:Create(inst,TweenInfo.new(dur,eas or Enum.EasingStyle.Quad,dir or Enum.EasingDirection.Out),prop):Play()
  64. end
  65. function createpropertyframebase(parent,name)
  66.     local new = create("Frame",{
  67.         Parent = parent,
  68.         Size = UDim2.new(1, 0,0, 20),
  69.         BackgroundTransparency = 1,
  70.     })
  71.     local label = create("TextLabel",{
  72.         Parent = new,
  73.         Position = UDim2.new(0, 0,0.5, 0),
  74.         Size = UDim2.new(1, -40,0, 10),
  75.         BackgroundTransparency = 1,
  76.         AnchorPoint = Vector2.new(0, 0.5),
  77.         Font = Enum.Font.Gotham,
  78.         Text = name,
  79.         TextColor3 = Color3.fromRGB(255, 255, 255),
  80.         TextSize = 12,
  81.         TextXAlignment = Enum.TextXAlignment.Left,
  82.     })
  83.     return new
  84. end
  85. local openvalues = {
  86.     [true] = {
  87.         Size = UDim2.new(0, 200,0, 125),
  88.         ButtonRotation = 90
  89.     },
  90.     [false] = {
  91.         Size = UDim2.new(0, 40,0, 125),
  92.         ButtonRotation = -90
  93.     }
  94. }
  95. local booleanpositions = {
  96.     [true] = UDim2.new(0.5, 0,0, 0),
  97.     [false] = UDim2.new(0, 0,0, 0)
  98. }
  99. local createproperty = {
  100.     Boolean = function(frame,name,default)
  101.         local new = createpropertyframebase(frame,name)
  102.         local is_true = default or false
  103.         local button = create("TextButton",{
  104.             Parent = new,
  105.             Position = UDim2.new(1, 0,0.5, 0),
  106.             Size = UDim2.new(0, 50,0, 15),
  107.             BackgroundColor3 = Color3.fromRGB(24, 24, 24),
  108.             AnchorPoint = Vector2.new(1, 0.5),
  109.             Text = "",
  110.             BorderSizePixel = 0
  111.         })
  112.         create("TextLabel",{
  113.             Parent = button,
  114.             Size = UDim2.new(0.5, 0,1, 0),
  115.             BackgroundTransparency = 1,
  116.             Font = Enum.Font.Gotham,
  117.             Text = 0,
  118.             TextColor3 = Color3.fromRGB(255, 255, 255),
  119.             TextSize = 14
  120.         })
  121.         create("TextLabel",{
  122.             Parent = button,
  123.             Position = UDim2.new(0.5, 0,0, 0),
  124.             Size = UDim2.new(0.5, 0,1, 0),
  125.             BackgroundTransparency = 1,
  126.             Font = Enum.Font.Gotham,
  127.             Text = 1,
  128.             TextColor3 = Color3.fromRGB(255, 255, 255),
  129.             TextSize = 14
  130.         })
  131.         local highlight = create("Frame",{
  132.             Parent = button,
  133.             Size = UDim2.new(0.5, 0,1, 0),
  134.             BackgroundTransparency = 0.9,
  135.             BorderSizePixel = 0,
  136.             ZIndex = 2,
  137.             Position = booleanpositions[is_true]
  138.         })
  139.         local event = create("BindableEvent",{Parent=new})
  140.         local returnee = {
  141.             PropertyChanged = event.Event,
  142.             Value = is_true
  143.         }
  144.         button.MouseButton1Click:Connect(function()
  145.             is_true = not is_true
  146.             tween(highlight,{Position=booleanpositions[is_true]},0.2)
  147.             returnee.Value = is_true
  148.             event:Fire(is_true)
  149.         end)
  150.         return returnee
  151.     end,
  152.     Number = function(frame,name,default)
  153.         local new = createpropertyframebase(frame,name)
  154.         local textbox = create("TextBox",{
  155.             Parent = new,
  156.             Position = UDim2.new(1, 0,0.5, 0),
  157.             Size = UDim2.new(0, 30,0, 15),
  158.             BackgroundColor3 = Color3.fromRGB(24, 24, 24),
  159.             AnchorPoint = Vector2.new(1, 0.5),
  160.             Font = Enum.Font.Gotham,
  161.             Text = "",
  162.             PlaceholderText = tostring(default or "") or 0,
  163.             TextColor3 = Color3.fromRGB(255, 255, 255),
  164.             TextSize = 14,
  165.             BorderSizePixel = 0
  166.         })
  167.         local event = create("BindableEvent",{Parent=new})
  168.         local returnee = {
  169.             PropertyChanged = event.Event,
  170.             Value = tostring(default or "") or 0
  171.         }
  172.         textbox.FocusLost:Connect(function()
  173.             local newvalue = tonumber(textbox.Text)
  174.             textbox.Text = newvalue or ""
  175.             returnee.Value = newvalue
  176.             event:Fire(newvalue or default)
  177.         end)
  178.         return returnee
  179.     end,
  180.     String = function(frame,name,default)
  181.         local new = createpropertyframebase(frame,name)
  182.         local textbox = create("TextBox",{
  183.             Parent = new,
  184.             Position = UDim2.new(1, 0,0.5, 0),
  185.             Size = UDim2.new(0, 50,0, 15),
  186.             BackgroundColor3 = Color3.fromRGB(24, 24, 24),
  187.             AnchorPoint = Vector2.new(1, 0.5),
  188.             Font = Enum.Font.Gotham,
  189.             Text = "",
  190.             PlaceholderText = tostring(default or ""),
  191.             TextColor3 = Color3.fromRGB(255, 255, 255),
  192.             TextSize = 14,
  193.             BorderSizePixel = 0
  194.         })
  195.         local event = create("BindableEvent",{Parent=new})
  196.         local returnee = {
  197.             PropertyChanged = event.Event,
  198.             Value = default or 0
  199.         }
  200.         textbox.FocusLost:Connect(function()
  201.             local newvalue = textbox.Text
  202.             textbox.Text = newvalue or ""
  203.             returnee.Value = newvalue
  204.             event:Fire(newvalue or default)
  205.         end)
  206.         return returnee
  207.     end,
  208. }
  209. if not _G.becomefumopanel then
  210.     _G.becomefumopanel = {}
  211.     local scriptframes,open = {},true
  212.     local panel = create("ScreenGui",{
  213.         Parent = game:GetService("CoreGui"), -- for general usage
  214.         --Parent = game.Players.LocalPlayer.PlayerGui, -- for testing
  215.         ResetOnSpawn = false,
  216.         Name = "BecomeFumoScriptPanel",
  217.         DisplayOrder = 6
  218.     })
  219.     local frame = create("Frame",{
  220.         Parent = panel,
  221.         BackgroundColor3 = Color3.fromRGB(24, 24, 24),
  222.         Position = UDim2.new(0, 5,1, -5),
  223.         Size = UDim2.new(0, 200,0, 125),
  224.         AnchorPoint = Vector2.new(0, 1),
  225.         ClipsDescendants = true
  226.     })
  227.     create("UICorner",{
  228.         Parent = frame,
  229.         CornerRadius = UDim.new(0, 4)
  230.     })
  231.     create("Frame",{
  232.         Parent = frame,
  233.         AnchorPoint = Vector2.new(0.5, 0),
  234.         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  235.         BorderSizePixel = 0,
  236.         Position = UDim2.new(0.5, 0,0, 30),
  237.         Size = UDim2.new(1, -20,0, 2)
  238.     })
  239.     local openclosebutton = create("ImageButton",{
  240.         Parent = frame,
  241.         BackgroundTransparency = 1,
  242.         AnchorPoint = Vector2.new(1, 0),
  243.         Position = UDim2.new(1, -10,0, 5),
  244.         Size = UDim2.new(0, 20,0, 20),
  245.         Image = "rbxassetid://4430382116",
  246.         Rotation = 90
  247.     })
  248.     local list = create("ScrollingFrame",{
  249.         Parent = frame,
  250.         BackgroundTransparency = 1,
  251.         Position = UDim2.new(0, 10,0, 35),
  252.         Size = UDim2.new(0, 40,1, -45),
  253.         BorderSizePixel = 0,
  254.         ScrollBarThickness = 0,
  255.     })
  256.     local uilist = create("UIListLayout",{Parent = list})
  257.     local settingsframe = create("Frame",{
  258.         Parent = frame,
  259.         BackgroundColor3 = Color3.fromRGB(13, 13, 13),
  260.         BorderSizePixel = 0,
  261.         AnchorPoint = Vector2.new(1, 0),
  262.         Position = UDim2.new(1, -10,0, 35),
  263.         Size = UDim2.new(1, -70,1, -45),
  264.     })
  265.     openclosebutton.MouseButton1Click:Connect(function()
  266.         open = not open
  267.         local props = openvalues[open]
  268.         tween(frame,{Size=props.Size},0.2)
  269.         openclosebutton.Rotation,list.Visible,settingsframe.Visible = props.ButtonRotation,open,open
  270.     end)
  271.     function _G.becomefumopanel:AddScript(name)
  272.         local button,settings = create("TextButton",{
  273.             Parent = list,
  274.             BackgroundColor3 = Color3.fromRGB(13, 13, 13),
  275.             BorderSizePixel = 0,
  276.             Size = UDim2.new(1, 0,0, 15),
  277.             Font = Enum.Font.Gotham,
  278.             Text = name,
  279.             TextColor3 = Color3.fromRGB(255, 255, 255),
  280.             TextSize = 12,
  281.         }),{}
  282.         list.CanvasSize = UDim2.new(0, 0,0, uilist.AbsoluteContentSize.Y)
  283.         local daframe = create("ScrollingFrame",{
  284.             Parent = settingsframe,
  285.             BackgroundTransparency = 1,
  286.             BorderSizePixel = 0,
  287.             Size = UDim2.new(1, 0,1, 0),
  288.             ScrollBarThickness = 0,
  289.             Visible = false
  290.         })
  291.         local label = create("TextLabel",{
  292.             Parent = daframe,
  293.             BackgroundTransparency = 1,
  294.             Position = UDim2.new(0, 10,0, 5),
  295.             Size = UDim2.new(1, -25,0, 15),
  296.             Font = Enum.Font.Gotham,
  297.             Text = name,
  298.             TextColor3 = Color3.fromRGB(255, 255, 255),
  299.             TextSize = 12,
  300.             TextXAlignment = Enum.TextXAlignment.Left
  301.         })
  302.         create("Frame",{
  303.             Parent = daframe,
  304.             BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  305.             BorderSizePixel = 0,
  306.             AnchorPoint = Vector2.new(0.5, 0),
  307.             Position = UDim2.new(0.5, 0,0, 20),
  308.             Size = UDim2.new(1, -20,0, 2)
  309.         })
  310.         local darealframe = create("Frame",{
  311.             Parent = daframe,
  312.             BorderSizePixel = 0,
  313.             Position = UDim2.new(0.5, 0,0, 30),
  314.             AnchorPoint = Vector2.new(0.5, 0),
  315.             Size = UDim2.new(1, -20,0, 0)
  316.         })
  317.         scriptframes[name] = {Frame=daframe,Button=button}
  318.         button.MouseButton1Click:Connect(function()
  319.             for i, v in next, scriptframes do
  320.                 v.Frame.Visible = name == i
  321.             end
  322.         end)
  323.         local uilist2 = create("UIListLayout",{Parent = darealframe})
  324.         function settings:AddProperty(propertyname,propertytype,defaultvalue)
  325.             local method = createproperty[propertytype]
  326.             if method then
  327.                 local returnee = method(darealframe,propertyname,defaultvalue)
  328.                 daframe.CanvasSize = UDim2.new(0, 0,0, uilist2.AbsoluteContentSize.Y + 40)
  329.                 return returnee
  330.             end
  331.         end
  332.         return settings
  333.     end
  334.     function _G.becomefumopanel:RemoveScript(name)
  335.         local stuff = scriptframes[name]
  336.         if stuff then
  337.             stuff.Frame:Destroy()
  338.             stuff.Button:Destroy()
  339.             scriptframes[name] = nil
  340.         end
  341.     end
  342. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement