Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players").LocalPlayer
- local mouse = plr:GetMouse()
- local rs = game:GetService("RunService")
- local uis = game:GetService("UserInputService")
- local function drag(GTD,d_speed)
- spawn(function()
- local gui = GTD
- local dragging
- local dragInput
- local dragStart
- local startPos
- function Lerp(a, b, m)
- return a + (b - a) * m
- end;
- local lastMousePos
- local lastGoalPos
- local DRAG_SPEED = (d_speed);
- function Update(dt)
- if not (startPos) then return end;
- if not (dragging) and (lastGoalPos) then
- gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, lastGoalPos.X.Offset, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, lastGoalPos.Y.Offset, dt * DRAG_SPEED))
- return
- end;
- local delta = (lastMousePos - uis:GetMouseLocation())
- local xGoal = (startPos.X.Offset - delta.X);
- local yGoal = (startPos.Y.Offset - delta.Y);
- lastGoalPos = UDim2.new(startPos.X.Scale, xGoal, startPos.Y.Scale, yGoal)
- gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, xGoal, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, yGoal, dt * DRAG_SPEED))
- end;
- gui.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = gui.Position
- lastMousePos = uis:GetMouseLocation()
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- rs.Heartbeat:Connect(Update)
- end)
- end
- function rainbow(obj,speed,p)
- local rainbow_speed = speed or 5
- local object = obj or false
- local to = p
- spawn(function()
- while object do
- rs.Stepped:wait()
- object[to] = Color3.fromRGB(255,0,0)
- for i = 0,255,rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(255,i,0)
- end
- for i = 255,0,-rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(i,255,0)
- end
- for i = 0,255,rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(0,255,i)
- end
- for i = 255,0,-rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(0,i,255)
- end
- for i = 0,255,rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(i,0,255)
- end
- for i = 255,0,-rainbow_speed do
- wait()
- object[to] = Color3.fromRGB(255,0,i)
- end
- end
- end)
- end
- local Keystrokes = Instance.new("ScreenGui")
- local MainFrame = Instance.new("Frame")
- local w = Instance.new("TextLabel")
- local UICorner = Instance.new("UICorner")
- local s = Instance.new("TextLabel")
- local UICorner_2 = Instance.new("UICorner")
- local d = Instance.new("TextLabel")
- local UICorner_3 = Instance.new("UICorner")
- local a = Instance.new("TextLabel")
- local UICorner_4 = Instance.new("UICorner")
- local mb1 = Instance.new("TextLabel")
- local UICorner_5 = Instance.new("UICorner")
- local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
- local mb2 = Instance.new("TextLabel")
- local UICorner_6 = Instance.new("UICorner")
- local space = Instance.new("TextLabel")
- local UICorner_7 = Instance.new("UICorner")
- Keystrokes.Name = "Keystrokes"
- Keystrokes.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- Keystrokes.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Keystrokes.ResetOnSpawn = false
- MainFrame.Name = "MainFrame"
- MainFrame.Parent = Keystrokes
- MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- MainFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- MainFrame.BackgroundTransparency = 1.000
- MainFrame.Position = UDim2.new(0.120211348, 0, 0.469785571, 0)
- MainFrame.Size = UDim2.new(0.150000003, 0, 0.250000012, 0)
- w.Name = "w"
- w.Parent = MainFrame
- w.AnchorPoint = Vector2.new(0.5, 0.5)
- w.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- w.BorderSizePixel = 0
- w.Position = UDim2.new(0.5, 0, 0.125, 0)
- w.Size = UDim2.new(0.25, 0, 0.25, 0)
- w.Font = Enum.Font.SourceSans
- w.Text = "W"
- w.TextColor3 = Color3.fromRGB(255, 255, 255)
- w.TextScaled = true
- w.TextSize = 14.000
- w.TextWrapped = true
- UICorner.Parent = w
- s.Name = "s"
- s.Parent = MainFrame
- s.AnchorPoint = Vector2.new(0.5, 0.5)
- s.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- s.BorderSizePixel = 0
- s.Position = UDim2.new(0.5, 0, 0.425000012, 0)
- s.Size = UDim2.new(0.25, 0, 0.25, 0)
- s.Font = Enum.Font.SourceSans
- s.Text = "S"
- s.TextColor3 = Color3.fromRGB(255, 255, 255)
- s.TextScaled = true
- s.TextSize = 14.000
- s.TextWrapped = true
- UICorner_2.Parent = s
- d.Name = "d"
- d.Parent = MainFrame
- d.AnchorPoint = Vector2.new(0.5, 0.5)
- d.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- d.BorderSizePixel = 0
- d.Position = UDim2.new(0.800000012, 0, 0.425000012, 0)
- d.Size = UDim2.new(0.25, 0, 0.25, 0)
- d.Font = Enum.Font.SourceSans
- d.Text = "D"
- d.TextColor3 = Color3.fromRGB(255, 255, 255)
- d.TextScaled = true
- d.TextSize = 14.000
- d.TextWrapped = true
- UICorner_3.Parent = d
- a.Name = "a"
- a.Parent = MainFrame
- a.AnchorPoint = Vector2.new(0.5, 0.5)
- a.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- a.BorderSizePixel = 0
- a.Position = UDim2.new(0.200000003, 0, 0.425000012, 0)
- a.Size = UDim2.new(0.25, 0, 0.25, 0)
- a.Font = Enum.Font.SourceSans
- a.Text = "A"
- a.TextColor3 = Color3.fromRGB(255, 255, 255)
- a.TextScaled = true
- a.TextSize = 14.000
- a.TextWrapped = true
- UICorner_4.Parent = a
- mb1.Name = "mb1"
- mb1.Parent = MainFrame
- mb1.AnchorPoint = Vector2.new(0.5, 0.5)
- mb1.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- mb1.BorderSizePixel = 0
- mb1.Position = UDim2.new(0.273999989, 0, 0.899999976, 0)
- mb1.Size = UDim2.new(0.401915461, 0, 0.200000003, 0)
- mb1.Font = Enum.Font.SourceSans
- mb1.Text = "LMB: 0"
- mb1.TextColor3 = Color3.fromRGB(255, 255, 255)
- mb1.TextSize = 19.000
- mb1.TextWrapped = true
- mb1.TextXAlignment = Enum.TextXAlignment.Left
- UICorner_5.Parent = mb1
- UITextSizeConstraint.Parent = mb1
- UITextSizeConstraint.MaxTextSize = 19
- mb2.Name = "mb2"
- mb2.Parent = MainFrame
- mb2.AnchorPoint = Vector2.new(0.5, 0.5)
- mb2.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- mb2.BorderSizePixel = 0
- mb2.Position = UDim2.new(0.721000016, 0, 0.899999976, 0)
- mb2.Size = UDim2.new(0.401915431, 0, 0.200000003, 0)
- mb2.Font = Enum.Font.SourceSans
- mb2.Text = "RMB: 0"
- mb2.TextColor3 = Color3.fromRGB(255, 255, 255)
- mb2.TextSize = 19.000
- mb2.TextWrapped = true
- mb2.TextXAlignment = Enum.TextXAlignment.Left
- UICorner_6.Parent = mb2
- space.Name = "space"
- space.Parent = MainFrame
- space.AnchorPoint = Vector2.new(0.5, 0.5)
- space.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- space.BorderSizePixel = 0
- space.Position = UDim2.new(0.5, 0, 0.675000012, 0)
- space.Size = UDim2.new(0.850000024, 0, 0.150000006, 0)
- space.Font = Enum.Font.SourceSans
- space.Text = "SPACE"
- space.TextColor3 = Color3.fromRGB(255, 255, 255)
- space.TextScaled = true
- space.TextSize = 14.000
- space.TextWrapped = true
- UICorner_7.Parent = space
- drag(MainFrame,8)
- mouse.KeyDown:Connect(function(key)
- if key=="w" then
- w.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- elseif key=="s" then
- s.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- elseif key=="a" then
- a.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- elseif key=="d" then
- d.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- elseif key==" " then
- space.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key=="w" then
- w.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- elseif key=="s" then
- s.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- elseif key=="a" then
- a.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- elseif key=="d" then
- d.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- elseif key==" " then
- space.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- end
- end)
- local mb1Clicked = 0
- local mb2Clicked = 0
- mouse.Button1Down:Connect(function()
- mb1.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- mb1Clicked = mb1Clicked+1
- spawn(function()
- wait(1)
- mb1Clicked = mb1Clicked-1
- end)
- end)
- mouse.Button1Up:Connect(function()
- mb1.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- end)
- mouse.Button2Down:Connect(function()
- mb2.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- mb2Clicked = mb2Clicked+1
- spawn(function()
- wait(1)
- mb2Clicked = mb2Clicked-1
- end)
- end)
- mouse.Button2Up:Connect(function()
- mb2.BackgroundColor3 = Color3.fromRGB(59, 59, 59)
- end)
- rainbow(w,10,"TextColor3")
- rainbow(s,10,"TextColor3")
- rainbow(a,10,"TextColor3")
- rainbow(d,10,"TextColor3")
- rainbow(space,10,"TextColor3")
- rainbow(mb1,10,"TextColor3")
- rainbow(mb2,10,"TextColor3")
- spawn(function()
- while true do rs.Stepped:wait()
- mb1.Text = "LMB: "..mb1Clicked
- mb2.Text = "RMB: "..mb2Clicked
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment