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()
- -- Função para criar a interface de usuário
- local function createUI()
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Title = Instance.new("TextLabel")
- local CFrameInput = Instance.new("TextBox")
- local ApplyButton = Instance.new("TextButton")
- ScreenGui.Name = "CFrameChangerUI"
- ScreenGui.Parent = game.CoreGui
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- Frame.Position = UDim2.new(0.3, 0, 0.3, 0)
- Frame.Size = UDim2.new(0, 300, 0, 150)
- Frame.Active = true
- Frame.Draggable = true
- Title.Parent = Frame
- Title.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- Title.Size = UDim2.new(1, 0, 0, 40)
- Title.Font = Enum.Font.SourceSansBold
- Title.Text = "Enter CFrame"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 20
- CFrameInput.Parent = Frame
- CFrameInput.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- CFrameInput.Position = UDim2.new(0.1, 0, 0.4, 0)
- CFrameInput.Size = UDim2.new(0.8, 0, 0, 30)
- CFrameInput.Font = Enum.Font.SourceSans
- CFrameInput.PlaceholderText = "Enter CFrame values"
- CFrameInput.Text = ""
- CFrameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
- CFrameInput.TextSize = 18
- ApplyButton.Parent = Frame
- ApplyButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- ApplyButton.Position = UDim2.new(0.1, 0, 0.7, 0)
- ApplyButton.Size = UDim2.new(0.8, 0, 0, 30)
- ApplyButton.Font = Enum.Font.SourceSansBold
- ApplyButton.Text = "Apply CFrame"
- ApplyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- ApplyButton.TextSize = 18
- return CFrameInput, ApplyButton
- end
- -- Criando a UI
- local CFrameInput, ApplyButton = createUI()
- -- Função para converter a string em CFrame
- local function parseCFrame(input)
- local values = {}
- for value in input:gmatch("[^,]+") do
- table.insert(values, tonumber(value))
- end
- if #values == 12 then
- return CFrame.new(
- values[1], values[2], values[3],
- values[4], values[5], values[6],
- values[7], values[8], values[9],
- values[10], values[11], values[12]
- )
- else
- warn("Invalid CFrame input.")
- return nil
- end
- end
- -- Função para aplicar o CFrame inserido pelo jogador
- local function applyCFrame(cframeString)
- if character and character:FindFirstChild("HumanoidRootPart") then
- local humanoidRootPart = character.HumanoidRootPart
- local newCFrame = parseCFrame(cframeString)
- if newCFrame then
- humanoidRootPart.CFrame = newCFrame
- print("CFrame applied: ", newCFrame)
- else
- warn("Failed to apply CFrame.")
- end
- end
- end
- -- Conectando o botão para aplicar o CFrame
- ApplyButton.MouseButton1Click:Connect(function()
- applyCFrame(CFrameInput.Text)
- end)
Advertisement
Add Comment
Please, Sign In to add comment