Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- function smooth_show(object, speed, size)
- local actual_size = size
- object.Size = UDim2.new(0.05, 0, 0.05, 0)
- object.Visible = true
- if object:FindFirstChild('shrinking') then
- return
- end
- for i = 0.01 * speed, actual_size.X.Scale, 0.01 * speed do
- object.Size = object.Size + UDim2.new(0.01 * speed, 0, 0, 0)
- wait()
- end
- for i = 0.01 * speed, actual_size.Y.Scale, 0.01 * speed do
- object.Size = object.Size + UDim2.new(0, 0, 0.01 * speed, 0)
- wait()
- end
- end
- function smooth_shrink(object, speed)
- local actual_size = object.Size
- local shrinking = Instance.new('IntValue')
- shrinking.Name = 'shrinking'
- shrinking.Parent = object
- for i = actual_size.X.Scale, 0.01, -0.01 do
- if object.Size.X.Scale - 0.01 * speed < 0 then
- if object.Size.X.Scale - 0.01 < 0 then
- break
- else
- object.Size = object.Size - UDim2.new(0.01, 0, 0, 0)
- end
- else
- object.Size = object.Size - UDim2.new(0.01 * speed, 0, 0, 0)
- end
- wait()
- end
- for i = actual_size.Y.Scale, 0.01, -0.01 * speed do
- if object.Size.Y.Scale - 0.01 * speed < 0 then
- if object.Size.Y.Scale - 0.01 < 0 then
- break
- else
- object.Size = object.Size - UDim2.new(0, 0, 0.01, 0)
- end
- else
- object.Size = object.Size - UDim2.new(0, 0, 0.01 * speed, 0)
- end
- wait()
- end
- object.Visible = false
- shrinking:Remove()
- end
- function check_table(item, tablee)
- for _, v in pairs(tablee) do
- if v == item then
- return true
- end
- end
- return false
- end
- local current_working = {}
- function show_text(object, text, speed)
- if object:FindFirstChild('showing') then
- return
- end
- local showing = Instance.new('IntValue')
- showing.Name = 'showing'
- showing.Parent = object
- object.Text = ''
- for i = 1, #text, 1 do
- if object.Visible == false then object.Text = ''; break end
- object.Text = object.Text .. string.sub(text, i, i)
- wait(speed)
- end
- showing:Remove()
- end
- function confirm_options(object, options)
- for k, v in pairs(options) do
- object[k] = v
- end
- end
- function decorate_button(object, options)
- local current_background = object.BackgroundColor3
- local current_text = object.TextColor3
- object.MouseEnter:Connect(function()
- object.BackgroundColor3 = options['Enter']['Background']
- object.TextColor3 = options['Enter']['Text']
- end)
- object.MouseLeave:Connect(function()
- object.BackgroundColor3 = current_background
- object.TextColor3 = current_text
- end)
- end
- local gui = Instance.new('ScreenGui')
- gui.ResetOnSpawn = false
- gui.Parent = player.PlayerGui
- local main_frame = Instance.new('Frame')
- main_frame.Visible = false
- main_frame.Style = Enum.FrameStyle.DropShadow
- main_frame.Size = UDim2.new(0.125, 0, 0.25, 0)
- main_frame.Position = UDim2.new(0, 0, 0.5, 0)
- main_frame.Parent = gui
- smooth_show(main_frame, 1, main_frame.Size)
- local caption = Instance.new('TextLabel')
- caption.Size = UDim2.new(1, 0, 0.125, 0)
- caption.BackgroundColor3 = Color3.new(0, 0, 0)
- caption.BackgroundTransparency = 0.5
- caption.TextColor3 = Color3.new(200, 0, 0)
- caption.TextSize = 18
- caption.Font = Enum.Font.Fantasy
- caption.Text = ""
- caption.Parent = main_frame
- show_text(caption, "Sarnaif'S GUI", 0.01)
- local mf_standard_button = {
- ['Size'] = UDim2.new(1, 0, 0.3, 0),
- ['BackgroundColor3'] = Color3.new(0, 0, 0),
- ['BackgroundTransparency'] = 0.5,
- ['TextColor3'] = Color3.new(0, 200, 200),
- ['TextSize'] = 18,
- ['Font'] = Enum.Font.Fantasy,
- ['Parent'] = main_frame
- }
- mf_standard_label = {
- ['Size'] = UDim2.new(2, 0, 0.29, 0),
- ['BackgroundColor3'] = Color3.new(0, 0, 0),
- ['BackgroundTransparency'] = 0.5,
- ['TextColor3'] = Color3.new(0, 200, 200),
- ['TextScaled'] = true,
- ['TextSize'] = 18,
- ['Font'] = Enum.Font.Fantasy,
- ['Parent'] = main_frame
- }
- mf_standard_frame = {
- ['Style'] = Enum.FrameStyle.DropShadow,
- ['Size'] = UDim2.new(0.875, 0, 0.3, 0),
- ['Position'] = UDim2.new(0.16, 0, 0.5, 0),
- ['Parent'] = gui
- }
- local misc = Instance.new('Frame')
- misc.Visible = false
- misc.Name = 'Misc'
- confirm_options(misc, mf_standard_frame)
- local teleports = Instance.new('Frame')
- teleports.Visible = false
- teleports.Name = 'Teleports'
- confirm_options(teleports, mf_standard_frame)
- local explorer = Instance.new('Frame')
- explorer.Visible = false
- explorer.Name = 'Explorer'
- confirm_options(explorer, mf_standard_frame)
- local mf_buttons = {
- ['Part. Explorer'] = {
- ['Frame'] = explorer,
- ['Description'] = 'Displays a menu consisting of available Haki Books / Devil Fruits / Treasure Chests. You\'re able to teleport yourself to them / teleport them to you.'
- },
- ['Teleports'] = {
- ['Frame'] = teleports,
- ['Description'] = 'Shows the most important points of the game and makes you able to teleport to them.'
- },
- ['Misc'] = {
- ['Frame'] = misc,
- ['Description'] = 'Shows miscellaneous options.'
- }
- }
- local mf_decorate = {
- ['Enter'] = {
- ['Background'] = Color3.new(0, 20, 20),
- ['Text'] = Color3.new(0, 180, 180)
- }
- }
- for _, v in pairs({misc, teleports, explorer}) do
- local frame_caption = Instance.new('TextLabel')
- confirm_options(frame_caption, mf_standard_label)
- frame_caption.Position = UDim2.new(0, 0, 0, 0)
- frame_caption.Size = UDim2.new(0.45, 0, 0.125, 0)
- frame_caption.Text = v.Name
- frame_caption.Parent = v
- end
- --START
- -- Misc
- --Teleports
- --Explorer
- -- END
- local opened = {false, nil}
- local current_shift = 0.12
- for k, v in pairs(mf_buttons) do
- local mf_button = Instance.new('TextButton')
- local size = v['Frame'].Size
- confirm_options(mf_button, mf_standard_button)
- mf_button.Position = UDim2.new(0, 0, current_shift, 0)
- decorate_button(mf_button, mf_decorate)
- show_text(mf_button, k, 0.01)
- mf_button.MouseButton1Click:Connect(function()
- if opened[1] == false then
- smooth_show(v['Frame'], 10, size)
- opened[1] = true
- opened[2] = v['Frame']
- else
- if opened[2] == v['Frame'] then
- smooth_shrink(v['Frame'], 10)
- opened[1] = false
- opened[2] = nil
- else
- smooth_shrink(opened[2], 10)
- smooth_show(v['Frame'], 10, size)
- opened[2] = v['Frame']
- end
- end
- end)
- current_shift = current_shift + 0.29
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement