Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Function to setup the GUI
- local function setupGui()
- for _, obj in ipairs(player.PlayerGui:GetChildren()) do
- if obj:IsA("ScreenGui") and obj.Name == "CustomGui" then
- obj:Destroy()
- end
- end
- local mouse = player:GetMouse()
- local humanoid = character:WaitForChild("Humanoid")
- -- GUI Elements
- local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
- local mainFrame = Instance.new("Frame", screenGui)
- local button = Instance.new("TextButton", screenGui)
- local speedLabel = Instance.new("TextLabel", mainFrame)
- local speedInput = Instance.new("TextBox", mainFrame)
- local jumpLabel = Instance.new("TextLabel", mainFrame)
- local jumpInput = Instance.new("TextBox", mainFrame)
- local setButton = Instance.new("TextButton", mainFrame)
- local resetSpeedButton = Instance.new("TextButton", mainFrame)
- local resetJumpButton = Instance.new("TextButton", mainFrame)
- local closeButton = Instance.new("TextButton", mainFrame)
- local settingsButton = Instance.new("TextButton", mainFrame)
- local languageFrame = Instance.new("Frame", mainFrame)
- local englishButton = Instance.new("TextButton", languageFrame)
- local turkishButton = Instance.new("TextButton", languageFrame)
- -- Initial properties
- screenGui.Name = "CustomGui"
- screenGui.ResetOnSpawn = false
- mainFrame.Name = "MainFrame"
- mainFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- mainFrame.BorderSizePixel = 0
- mainFrame.Position = UDim2.new(0.3, 0, 0.3, 0)
- mainFrame.Size = UDim2.new(0, 300, 0, 300)
- mainFrame.Visible = false
- mainFrame.Draggable = true
- mainFrame.Active = true
- button.Name = "OpenButton"
- button.Text = "Open Menu"
- button.Position = UDim2.new(0.4, 0, 0.4, 0)
- button.Size = UDim2.new(0, 150, 0, 50)
- button.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.Font = Enum.Font.SourceSansBold
- button.TextSize = 24
- button.Active = true
- button.Draggable = true
- button.MouseButton1Click:Connect(function()
- mainFrame.Visible = not mainFrame.Visible
- if mainFrame.Visible then
- mainFrame:TweenPosition(UDim2.new(0.3, 0, 0.3, 0), "Out", "Bounce", 0.5, true)
- else
- mainFrame:TweenPosition(UDim2.new(1, 0, 0.3, 0), "Out", "Bounce", 0.5, true)
- end
- end)
- speedLabel.Name = "SpeedLabel"
- speedLabel.Text = "Speed"
- speedLabel.Position = UDim2.new(0.1, 0, 0.1, 0)
- speedLabel.Size = UDim2.new(0, 100, 0, 25)
- speedLabel.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- speedLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
- speedLabel.Font = Enum.Font.SourceSansBold
- speedLabel.TextSize = 18
- speedInput.Name = "SpeedInput"
- speedInput.PlaceholderText = "Enter Speed"
- speedInput.Position = UDim2.new(0.5, 0, 0.1, 0)
- speedInput.Size = UDim2.new(0, 100, 0, 25)
- speedInput.BackgroundColor3 = Color3.fromRGB(230, 230, 230)
- speedInput.TextColor3 = Color3.fromRGB(0, 0, 0)
- speedInput.Font = Enum.Font.SourceSans
- speedInput.TextSize = 18
- jumpLabel.Name = "JumpLabel"
- jumpLabel.Text = "Jump Power"
- jumpLabel.Position = UDim2.new(0.1, 0, 0.3, 0)
- jumpLabel.Size = UDim2.new(0, 100, 0, 25)
- jumpLabel.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- jumpLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
- jumpLabel.Font = Enum.Font.SourceSansBold
- jumpLabel.TextSize = 18
- jumpInput.Name = "JumpInput"
- jumpInput.PlaceholderText = "Enter Jump Power"
- jumpInput.Position = UDim2.new(0.5, 0, 0.3, 0)
- jumpInput.Size = UDim2.new(0, 100, 0, 25)
- jumpInput.BackgroundColor3 = Color3.fromRGB(230, 230, 230)
- jumpInput.TextColor3 = Color3.fromRGB(0, 0, 0)
- jumpInput.Font = Enum.Font.SourceSans
- jumpInput.TextSize = 18
- setButton.Name = "SetButton"
- setButton.Text = "SET"
- setButton.Position = UDim2.new(0.1, 0, 0.5, 0)
- setButton.Size = UDim2.new(0, 100, 0, 25)
- setButton.BackgroundColor3 = Color3.fromRGB(60, 179, 113)
- setButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- setButton.Font = Enum.Font.SourceSansBold
- setButton.TextSize = 18
- setButton.MouseButton1Click:Connect(function()
- local speed = tonumber(speedInput.Text)
- local jumpPower = tonumber(jumpInput.Text)
- if speed then
- humanoid.WalkSpeed = speed
- end
- if jumpPower then
- humanoid.JumpPower = jumpPower
- end
- end)
- resetSpeedButton.Name = "ResetSpeedButton"
- resetSpeedButton.Text = "Reset Speed"
- resetSpeedButton.Position = UDim2.new(0.5, 0, 0.5, 0)
- resetSpeedButton.Size = UDim2.new(0, 100, 0, 25)
- resetSpeedButton.BackgroundColor3 = Color3.fromRGB(255, 69, 0)
- resetSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- resetSpeedButton.Font = Enum.Font.SourceSansBold
- resetSpeedButton.TextSize = 18
- resetSpeedButton.MouseButton1Click:Connect(function()
- humanoid.WalkSpeed = 16
- end)
- resetJumpButton.Name = "ResetJumpButton"
- resetJumpButton.Text = "Reset Jump"
- resetJumpButton.Position = UDim2.new(0.1, 0, 0.7, 0)
- resetJumpButton.Size = UDim2.new(0, 100, 0, 25)
- resetJumpButton.BackgroundColor3 = Color3.fromRGB(255, 69, 0)
- resetJumpButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- resetJumpButton.Font = Enum.Font.SourceSansBold
- resetJumpButton.TextSize = 18
- resetJumpButton.MouseButton1Click:Connect(function()
- humanoid.JumpPower = 50
- end)
- settingsButton.Name = "SettingsButton"
- settingsButton.Text = "Settings"
- settingsButton.Position = UDim2.new(0.5, 0, 0.7, 0)
- settingsButton.Size = UDim2.new(0, 100, 0, 25)
- settingsButton.BackgroundColor3 = Color3.fromRGB(135, 206, 250)
- settingsButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- settingsButton.Font = Enum.Font.SourceSansBold
- settingsButton.TextSize = 18
- settingsButton.MouseButton1Click:Connect(function()
- languageFrame.Visible = not languageFrame.Visible
- end)
- languageFrame.Name = "LanguageFrame"
- languageFrame.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- languageFrame.BorderSizePixel = 0
- languageFrame.Position = UDim2.new(0.6, 0, 0.9, 0)
- languageFrame.Size = UDim2.new(0, 120, 0, 50)
- languageFrame.Visible = false
- englishButton.Name = "EnglishButton"
- englishButton.Text = "English"
- englishButton.Position = UDim2.new(0.1, 0, 0.1, 0)
- englishButton.Size = UDim2.new(0, 100, 0, 25)
- englishButton.BackgroundColor3 = Color3.fromRGB(135, 206, 250)
- englishButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- englishButton.Font = Enum.Font.SourceSansBold
- englishButton.TextSize = 18
- englishButton.MouseButton1Click:Connect(function()
- speedLabel.Text = "Speed"
- speedInput.PlaceholderText = "Enter Speed"
- jumpLabel.Text = "Jump Power"
- jumpInput.PlaceholderText = "Enter Jump Power"
- setButton.Text = "SET"
- resetSpeedButton.Text = "Reset Speed"
- resetJumpButton.Text = "Reset Jump"
- settingsButton.Text = "Settings"
- end)
- turkishButton.Name = "TurkishButton"
- turkishButton.Text = "Turkish"
- turkishButton.Position = UDim2.new(0.1, 0, 0.6, 0)
- turkishButton.Size = UDim2.new(0, 100, 0, 25)
- turkishButton.BackgroundColor3 = Color3.fromRGB(135, 206, 250)
- turkishButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- turkishButton.Font = Enum.Font.SourceSansBold
- turkishButton.TextSize = 18
- turkishButton.MouseButton1Click:Connect(function()
- speedLabel.Text = "Hız"
- speedInput.PlaceholderText = "Hız Girin"
- jumpLabel.Text = "Zıplama Gücü"
- jumpInput.PlaceholderText = "Zıplama Gücü Girin"
- setButton.Text = "AYARLA"
- resetSpeedButton.Text = "Hızı Sıfırla"
- resetJumpButton.Text = "Zıplamayı Sıfırla"
- settingsButton.Text = "Ayarlar"
- end)
- closeButton.Name = "CloseButton"
- closeButton.Text = "X"
- closeButton.Position = UDim2.new(0.9, 0, 0, 0)
- closeButton.Size = UDim2.new(0, 25, 0, 25)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Font = Enum.Font.SourceSansBold
- closeButton.TextSize = 18
- closeButton.MouseButton1Click:Connect(function()
- mainFrame.Visible = false
- end)
- -- Animation
- button.MouseEnter:Connect(function()
- button:TweenSize(UDim2.new(0, 200, 0, 70), "Out", "Bounce", 0.5, true)
- end)
- button.MouseLeave:Connect(function()
- button:TweenSize(UDim2.new(0, 150, 0, 50), "Out", "Bounce", 0.5, true)
- end)
- -- Make the main frame draggable
- local UIS = game:GetService("UserInputService")
- local dragToggle = nil
- local dragSpeed = 0.25
- local dragStart = nil
- local startPos = nil
- local function updateInput(input)
- local delta = input.Position - dragStart
- mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- mainFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragToggle = true
- dragStart = input.Position
- startPos = mainFrame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragToggle = false
- end
- end)
- end
- end)
- mainFrame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- if dragToggle then
- updateInput(input)
- end
- end
- end)
- -- Dragging for the button
- button.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragToggle = true
- dragStart = input.Position
- startPos = button.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragToggle = false
- end
- end)
- end
- end)
- button.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- if dragToggle then
- local delta = input.Position - dragStart
- button.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end
- end)
- end
- -- Function to reset the GUI setup on respawn
- local function onCharacterAdded(char)
- character = char
- setupGui()
- end
- player.CharacterAdded:Connect(onCharacterAdded)
- -- Initial setup
- setupGui()
Advertisement
Add Comment
Please, Sign In to add comment