Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ceat_ceat
- become fumo script panel
- -----------------------------------------
- new script panel here:
- https://github.com/ceat-ceat/ScriptPanelv2/blob/main/scriptpanelv2.lua
- 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
- -----------------------------------------
- this panel script is made for become fumo but id imagine you can use it for other scripts too
- how to use:
- run the script with httpget or whatever
- sample code -----------------------------------------
- local new = _G.becomefumopanel:AddScript("lol")
- new:AddProperty("fat","String").PropertyChanged:Connect(function(value)
- print(value)
- end)
- _G.becomefumopanel:RemoveScript("lol")
- --------------------------
- _G.becomefumopanel:AddScript(name)
- - name is a string parameter, returns an add property function
- :AddProperty(name,type,default)
- - a function you use that is returns by the function above
- - adds a property the player can set to the panel
- - name is the property name, type is the property type, and default is the default value
- property types:
- - Boolean
- - Number
- - String
- this function returns a PropertyChanged event which passed the new value of the property and a Value property for direct property grabbing
- _G.becomefumopanel:RemoveScript(name)
- - name is a string parameter, removes a script with the name given
- 5/7/2021 changes:
- - the addproperty function now also returns a value property
- 6/9/2021 changes:
- - added _G.becomefumopanel:RemoveScript() to documentation
- ]]
- local ts = game:GetService("TweenService")
- function create(class,prop)
- local inst = Instance.new(class)
- if prop then
- for i, v in next, prop do
- inst[i] = v
- end
- end
- return inst
- end
- function tween(inst,prop,dur,dir,eas)
- ts:Create(inst,TweenInfo.new(dur,eas or Enum.EasingStyle.Quad,dir or Enum.EasingDirection.Out),prop):Play()
- end
- function createpropertyframebase(parent,name)
- local new = create("Frame",{
- Parent = parent,
- Size = UDim2.new(1, 0,0, 20),
- BackgroundTransparency = 1,
- })
- local label = create("TextLabel",{
- Parent = new,
- Position = UDim2.new(0, 0,0.5, 0),
- Size = UDim2.new(1, -40,0, 10),
- BackgroundTransparency = 1,
- AnchorPoint = Vector2.new(0, 0.5),
- Font = Enum.Font.Gotham,
- Text = name,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left,
- })
- return new
- end
- local openvalues = {
- [true] = {
- Size = UDim2.new(0, 200,0, 125),
- ButtonRotation = 90
- },
- [false] = {
- Size = UDim2.new(0, 40,0, 125),
- ButtonRotation = -90
- }
- }
- local booleanpositions = {
- [true] = UDim2.new(0.5, 0,0, 0),
- [false] = UDim2.new(0, 0,0, 0)
- }
- local createproperty = {
- Boolean = function(frame,name,default)
- local new = createpropertyframebase(frame,name)
- local is_true = default or false
- local button = create("TextButton",{
- Parent = new,
- Position = UDim2.new(1, 0,0.5, 0),
- Size = UDim2.new(0, 50,0, 15),
- BackgroundColor3 = Color3.fromRGB(24, 24, 24),
- AnchorPoint = Vector2.new(1, 0.5),
- Text = "",
- BorderSizePixel = 0
- })
- create("TextLabel",{
- Parent = button,
- Size = UDim2.new(0.5, 0,1, 0),
- BackgroundTransparency = 1,
- Font = Enum.Font.Gotham,
- Text = 0,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 14
- })
- create("TextLabel",{
- Parent = button,
- Position = UDim2.new(0.5, 0,0, 0),
- Size = UDim2.new(0.5, 0,1, 0),
- BackgroundTransparency = 1,
- Font = Enum.Font.Gotham,
- Text = 1,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 14
- })
- local highlight = create("Frame",{
- Parent = button,
- Size = UDim2.new(0.5, 0,1, 0),
- BackgroundTransparency = 0.9,
- BorderSizePixel = 0,
- ZIndex = 2,
- Position = booleanpositions[is_true]
- })
- local event = create("BindableEvent",{Parent=new})
- local returnee = {
- PropertyChanged = event.Event,
- Value = is_true
- }
- button.MouseButton1Click:Connect(function()
- is_true = not is_true
- tween(highlight,{Position=booleanpositions[is_true]},0.2)
- returnee.Value = is_true
- event:Fire(is_true)
- end)
- return returnee
- end,
- Number = function(frame,name,default)
- local new = createpropertyframebase(frame,name)
- local textbox = create("TextBox",{
- Parent = new,
- Position = UDim2.new(1, 0,0.5, 0),
- Size = UDim2.new(0, 30,0, 15),
- BackgroundColor3 = Color3.fromRGB(24, 24, 24),
- AnchorPoint = Vector2.new(1, 0.5),
- Font = Enum.Font.Gotham,
- Text = "",
- PlaceholderText = tostring(default or "") or 0,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 14,
- BorderSizePixel = 0
- })
- local event = create("BindableEvent",{Parent=new})
- local returnee = {
- PropertyChanged = event.Event,
- Value = tostring(default or "") or 0
- }
- textbox.FocusLost:Connect(function()
- local newvalue = tonumber(textbox.Text)
- textbox.Text = newvalue or ""
- returnee.Value = newvalue
- event:Fire(newvalue or default)
- end)
- return returnee
- end,
- String = function(frame,name,default)
- local new = createpropertyframebase(frame,name)
- local textbox = create("TextBox",{
- Parent = new,
- Position = UDim2.new(1, 0,0.5, 0),
- Size = UDim2.new(0, 50,0, 15),
- BackgroundColor3 = Color3.fromRGB(24, 24, 24),
- AnchorPoint = Vector2.new(1, 0.5),
- Font = Enum.Font.Gotham,
- Text = "",
- PlaceholderText = tostring(default or ""),
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 14,
- BorderSizePixel = 0
- })
- local event = create("BindableEvent",{Parent=new})
- local returnee = {
- PropertyChanged = event.Event,
- Value = default or 0
- }
- textbox.FocusLost:Connect(function()
- local newvalue = textbox.Text
- textbox.Text = newvalue or ""
- returnee.Value = newvalue
- event:Fire(newvalue or default)
- end)
- return returnee
- end,
- }
- if not _G.becomefumopanel then
- _G.becomefumopanel = {}
- local scriptframes,open = {},true
- local panel = create("ScreenGui",{
- Parent = game:GetService("CoreGui"), -- for general usage
- --Parent = game.Players.LocalPlayer.PlayerGui, -- for testing
- ResetOnSpawn = false,
- Name = "BecomeFumoScriptPanel",
- DisplayOrder = 6
- })
- local frame = create("Frame",{
- Parent = panel,
- BackgroundColor3 = Color3.fromRGB(24, 24, 24),
- Position = UDim2.new(0, 5,1, -5),
- Size = UDim2.new(0, 200,0, 125),
- AnchorPoint = Vector2.new(0, 1),
- ClipsDescendants = true
- })
- create("UICorner",{
- Parent = frame,
- CornerRadius = UDim.new(0, 4)
- })
- create("Frame",{
- Parent = frame,
- AnchorPoint = Vector2.new(0.5, 0),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0,
- Position = UDim2.new(0.5, 0,0, 30),
- Size = UDim2.new(1, -20,0, 2)
- })
- local openclosebutton = create("ImageButton",{
- Parent = frame,
- BackgroundTransparency = 1,
- AnchorPoint = Vector2.new(1, 0),
- Position = UDim2.new(1, -10,0, 5),
- Size = UDim2.new(0, 20,0, 20),
- Image = "rbxassetid://4430382116",
- Rotation = 90
- })
- local list = create("ScrollingFrame",{
- Parent = frame,
- BackgroundTransparency = 1,
- Position = UDim2.new(0, 10,0, 35),
- Size = UDim2.new(0, 40,1, -45),
- BorderSizePixel = 0,
- ScrollBarThickness = 0,
- })
- local uilist = create("UIListLayout",{Parent = list})
- local settingsframe = create("Frame",{
- Parent = frame,
- BackgroundColor3 = Color3.fromRGB(13, 13, 13),
- BorderSizePixel = 0,
- AnchorPoint = Vector2.new(1, 0),
- Position = UDim2.new(1, -10,0, 35),
- Size = UDim2.new(1, -70,1, -45),
- })
- openclosebutton.MouseButton1Click:Connect(function()
- open = not open
- local props = openvalues[open]
- tween(frame,{Size=props.Size},0.2)
- openclosebutton.Rotation,list.Visible,settingsframe.Visible = props.ButtonRotation,open,open
- end)
- function _G.becomefumopanel:AddScript(name)
- local button,settings = create("TextButton",{
- Parent = list,
- BackgroundColor3 = Color3.fromRGB(13, 13, 13),
- BorderSizePixel = 0,
- Size = UDim2.new(1, 0,0, 15),
- Font = Enum.Font.Gotham,
- Text = name,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 12,
- }),{}
- list.CanvasSize = UDim2.new(0, 0,0, uilist.AbsoluteContentSize.Y)
- local daframe = create("ScrollingFrame",{
- Parent = settingsframe,
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- Size = UDim2.new(1, 0,1, 0),
- ScrollBarThickness = 0,
- Visible = false
- })
- local label = create("TextLabel",{
- Parent = daframe,
- BackgroundTransparency = 1,
- Position = UDim2.new(0, 10,0, 5),
- Size = UDim2.new(1, -25,0, 15),
- Font = Enum.Font.Gotham,
- Text = name,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- create("Frame",{
- Parent = daframe,
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0,
- AnchorPoint = Vector2.new(0.5, 0),
- Position = UDim2.new(0.5, 0,0, 20),
- Size = UDim2.new(1, -20,0, 2)
- })
- local darealframe = create("Frame",{
- Parent = daframe,
- BorderSizePixel = 0,
- Position = UDim2.new(0.5, 0,0, 30),
- AnchorPoint = Vector2.new(0.5, 0),
- Size = UDim2.new(1, -20,0, 0)
- })
- scriptframes[name] = {Frame=daframe,Button=button}
- button.MouseButton1Click:Connect(function()
- for i, v in next, scriptframes do
- v.Frame.Visible = name == i
- end
- end)
- local uilist2 = create("UIListLayout",{Parent = darealframe})
- function settings:AddProperty(propertyname,propertytype,defaultvalue)
- local method = createproperty[propertytype]
- if method then
- local returnee = method(darealframe,propertyname,defaultvalue)
- daframe.CanvasSize = UDim2.new(0, 0,0, uilist2.AbsoluteContentSize.Y + 40)
- return returnee
- end
- end
- return settings
- end
- function _G.becomefumopanel:RemoveScript(name)
- local stuff = scriptframes[name]
- if stuff then
- stuff.Frame:Destroy()
- stuff.Button:Destroy()
- scriptframes[name] = nil
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement