Advertisement
Mhammed_2013

مم

Feb 14th, 2024 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2.  
  3. -- القائمة
  4. local menu = Instance.new("ScreenGui")
  5. local button = Instance.new("TextButton")
  6.  
  7. button.Text = "اضغط هنا للإختفاء/الظهور"
  8. button.Size = UDim2.new(0, 200, 0, 50)
  9. button.BackgroundColor3 = Color3.new(0, 0, 0) -- اللون الأسود
  10.  
  11. button.Parent = menu
  12. menu.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  13.  
  14. -- kkkkkkkkkkkkkkkkkkkkkkk
  15. local dragging
  16. local dragInput
  17. local dragStart
  18. local startPos
  19.  
  20. local function update(input)
  21. local delta = input.Position - dragStart
  22. menu.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  23. end
  24.  
  25. menu.InputBegan:Connect(function(input)
  26. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  27. dragging = true
  28. dragStart = input.Position
  29. startPos = menu.Position
  30.  
  31. input.Changed:Connect(function()
  32. if input.UserInputState == Enum.UserInputState.End then
  33. dragging = false
  34. end
  35. end)
  36. end
  37. end)
  38.  
  39. menu.InputChanged:Connect(function(input)
  40. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  41. dragInput = input
  42. end
  43. end)
  44.  
  45. UserInputService.InputChanged:Connect(function(input)
  46. if input == dragInput and dragging then
  47. update(input)
  48. end
  49. end)
  50.  
  51. -- k
  52. local invisible = false
  53.  
  54. button.MouseButton1Click:Connect(function()
  55. invisible = not invisible
  56.  
  57. for _, part in ipairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  58. if part:IsA("BasePart") then
  59. part.Transparency = invisible and 1 or 0
  60. end
  61. end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement