Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function decorateButton(button, color, s1, s2)
- local actualColor = button.BackgroundColor3
- button.MouseButton1Click:Connect(function()
- s1:Play()
- end)
- button.MouseEnter:Connect(function()
- s2:Play()
- button.BackgroundColor3 = color
- end)
- button.MouseLeave:Connect(function()
- button.BackgroundColor3 = actualColor
- end)
- end
- local plr = game.Players.LocalPlayer
- local gui = Instance.new('ScreenGui')
- gui.Parent = plr.PlayerGui
- gui.ResetOnSpawn = false
- local frame = Instance.new('Frame')
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.BackgroundTransparency = 0.5
- frame.Parent = gui
- local button1 = Instance.new('TextButton')
- button1.BackgroundColor3 = Color3.new(0, 0, 0)
- button1.BackgroundTransparency = 0.5
- button1.Font = Enum.Font.Gotham
- button1.Parent = gui
- button1.Text = 'Tools'
- button1.TextColor3 = Color3.new(0, 20, 20)
- button1.TextScaled = true
- local sound = Instance.new('Sound')
- sound.Parent = game.Workspace
- sound.SoundId = 'rbxassetid://537744814'
- sound.Volume = 2
- local sound2 = sound:Clone()
- sound2.Parent = game.Workspace
- sound2.SoundId = 'rbxassetid://408524543'
- decorateButton(button1, Color3.new(0, 20, 20), sound, sound2)
- local opened = true
- button1.MouseButton1Click:Connect(function()
- if opened == true then
- frame:TweenPosition(UDim2.new(0, 0, 1, 0))
- button1:TweenPosition(UDim2.new(0, 0, 0.95, 0))
- opened = false
- else
- frame:TweenPosition(UDim2.new(0, 0, 0.5, 0))
- button1:TweenPosition(UDim2.new(0, 0, 0.45, 0))
- opened = true
- end
- end)
- frame:TweenSize(UDim2.new(0.125, 0, 0.5, 0))
- frame:TweenPosition(UDim2.new(0, 0, 0.5, 0))
- button1:TweenSize(UDim2.new(0.125, 0, 0.05, 0))
- button1:TweenPosition(UDim2.new(0, 0, 0.45, 0))
- local buttons = {}
- local order = {}
- local nextPosition = nil
- function removeButton(object)
- local button = buttons[object]
- table.insert(order, button.Position)
- button.Text = ''
- button:TweenSize(UDim2.new(0, 0, 0, 0))
- wait(1)
- button:Destroy()
- button = nil
- end
- game.Workspace.ChildRemoved:Connect(function(child)
- if buttons[child] ~= nil then
- removeButton(child)
- end
- end)
- function addButton(object)
- wait(0.15)
- local button = Instance.new('TextButton')
- button.BackgroundColor3 = Color3.new(0, 0, 0)
- button.BackgroundTransparency = 0.75
- button.Parent = frame
- button.Position = UDim2.new(0, 0, -0.1, 0)
- button.Text = object.Name
- button.TextColor3 = Color3.new(0, 20, 20)
- button.TextScaled = true
- decorateButton(button, Color3.new(0, 20, 20), sound, sound2)
- button.MouseButton1Click:Connect(function()
- if game.Workspace:FindFirstChild(plr.Name) then
- local char = plr.Character
- local lastPos = char.HumanoidRootPart.Position
- if object.ClassName == 'Tool' then
- char:MoveTo(object.Handle.Position)
- else
- char:MoveTo(object.Position)
- end
- if gui:FindFirstChild('tp') then
- gui:FindFirstChild('tp'):Remove()
- end
- local tp = button:Clone()
- tp.BackgroundColor3 = Color3.new(0, 0, 0, 0)
- tp.BackgroundTransparency = 0.5
- tp.Name = 'tp'
- tp.Parent = gui
- tp.Position = UDim2.new(0, 0, -0.1, 0)
- tp.Size = UDim2.new(0, 0, 0, 0)
- tp.Text = 'Teleport back?'
- tp:TweenPosition(UDim2.new(0.13, 0, 0.95, 0))
- tp:TweenSize(UDim2.new(0.125, 0, 0.05, 0))
- decorateButton(tp, Color3.new(0, 20, 20), sound, sound2)
- local tped = false
- tp.MouseButton1Click:Connect(function()
- tped = true
- char:MoveTo(lastPos)
- tp.Name = ''
- tp.Text = ''
- tp:TweenSize(UDim2.new(0, 0, 0, 0))
- wait(1)
- tp:Remove()
- end)
- for i = 5, 1, -1 do
- tp.Text = 'Teleport back? ' .. i
- wait(1)
- end
- if tped == false then
- tp.Name = ''
- tp.Text = ''
- tp:TweenSize(UDim2.new(0, 0, 0, 0))
- wait(1)
- tp:Remove()
- end
- end
- end)
- if #order >= 1 then
- button:TweenPosition(order[#order])
- order[#order] = nil
- else
- if nextPosition then
- button:TweenPosition(nextPosition)
- nextPosition = nextPosition + UDim2.new(0, 0, 0.05, 0)
- else
- nextPosition = UDim2.new(0, 0, 0.05, 0)
- button:TweenPosition(UDim2.new(0, 0, 0, 0))
- end
- end
- button:TweenSize(UDim2.new(1, 0, 0.05, 0))
- buttons[object] = button
- end
- local black = {
- ['Shop'] = 1,
- ['crab'] = 1,
- ['bigmeter'] = 1
- }
- function valid(object)
- if black[object.Name] ~= nil then
- return false
- end
- if object.ClassName == 'Tool' and object:FindFirstChild('Handle') then
- return true
- elseif object.ClassName == 'Part' and object:FindFirstChild('ClickDetector') then
- return true
- end
- return false
- end
- for k, v in pairs(game.Workspace:GetChildren()) do
- if valid(v) then
- addButton(v)
- end
- end
- game.Workspace.ChildAdded:Connect(function(child)
- spawn(function()
- wait(1)
- if valid(child) then
- addButton(child)
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement