Ameno__GodOH

CFrame checker

Aug 12th, 2024
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local player = Players.LocalPlayer
  3. local character = player.Character or player.CharacterAdded:Wait()
  4.  
  5. -- Função para criar a interface de usuário
  6. local function createUI()
  7. local ScreenGui = Instance.new("ScreenGui")
  8. local Frame = Instance.new("Frame")
  9. local Title = Instance.new("TextLabel")
  10. local CFrameInput = Instance.new("TextBox")
  11. local ApplyButton = Instance.new("TextButton")
  12.  
  13. ScreenGui.Name = "CFrameChangerUI"
  14. ScreenGui.Parent = game.CoreGui
  15.  
  16. Frame.Parent = ScreenGui
  17. Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  18. Frame.Position = UDim2.new(0.3, 0, 0.3, 0)
  19. Frame.Size = UDim2.new(0, 300, 0, 150)
  20. Frame.Active = true
  21. Frame.Draggable = true
  22.  
  23. Title.Parent = Frame
  24. Title.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  25. Title.Size = UDim2.new(1, 0, 0, 40)
  26. Title.Font = Enum.Font.SourceSansBold
  27. Title.Text = "Enter CFrame"
  28. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  29. Title.TextSize = 20
  30.  
  31. CFrameInput.Parent = Frame
  32. CFrameInput.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  33. CFrameInput.Position = UDim2.new(0.1, 0, 0.4, 0)
  34. CFrameInput.Size = UDim2.new(0.8, 0, 0, 30)
  35. CFrameInput.Font = Enum.Font.SourceSans
  36. CFrameInput.PlaceholderText = "Enter CFrame values"
  37. CFrameInput.Text = ""
  38. CFrameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
  39. CFrameInput.TextSize = 18
  40.  
  41. ApplyButton.Parent = Frame
  42. ApplyButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  43. ApplyButton.Position = UDim2.new(0.1, 0, 0.7, 0)
  44. ApplyButton.Size = UDim2.new(0.8, 0, 0, 30)
  45. ApplyButton.Font = Enum.Font.SourceSansBold
  46. ApplyButton.Text = "Apply CFrame"
  47. ApplyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  48. ApplyButton.TextSize = 18
  49.  
  50. return CFrameInput, ApplyButton
  51. end
  52.  
  53. -- Criando a UI
  54. local CFrameInput, ApplyButton = createUI()
  55.  
  56. -- Função para converter a string em CFrame
  57. local function parseCFrame(input)
  58. local values = {}
  59. for value in input:gmatch("[^,]+") do
  60. table.insert(values, tonumber(value))
  61. end
  62. if #values == 12 then
  63. return CFrame.new(
  64. values[1], values[2], values[3],
  65. values[4], values[5], values[6],
  66. values[7], values[8], values[9],
  67. values[10], values[11], values[12]
  68. )
  69. else
  70. warn("Invalid CFrame input.")
  71. return nil
  72. end
  73. end
  74.  
  75. -- Função para aplicar o CFrame inserido pelo jogador
  76. local function applyCFrame(cframeString)
  77. if character and character:FindFirstChild("HumanoidRootPart") then
  78. local humanoidRootPart = character.HumanoidRootPart
  79. local newCFrame = parseCFrame(cframeString)
  80.  
  81. if newCFrame then
  82. humanoidRootPart.CFrame = newCFrame
  83. print("CFrame applied: ", newCFrame)
  84. else
  85. warn("Failed to apply CFrame.")
  86. end
  87. end
  88. end
  89.  
  90. -- Conectando o botão para aplicar o CFrame
  91. ApplyButton.MouseButton1Click:Connect(function()
  92. applyCFrame(CFrameInput.Text)
  93. end)
Advertisement
Add Comment
Please, Sign In to add comment