tomoneko

ロブロックス重力操作script

Oct 4th, 2023 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | Gaming | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local ScreenGui = Instance.new("ScreenGui")
  4. local increaseButton = Instance.new("TextButton")
  5. local decreaseButton = Instance.new("TextButton")
  6. local gravityLabel = Instance.new("TextLabel")
  7. local toggleButton = Instance.new("TextButton")
  8.  
  9. ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
  10.  
  11. increaseButton.Parent = ScreenGui
  12. increaseButton.Position = UDim2.new(1, -110, 0.5, -75)
  13. increaseButton.Size = UDim2.new(0, 100, 0, 50)
  14. increaseButton.Text = "↑"
  15.  
  16. decreaseButton.Parent = ScreenGui
  17. decreaseButton.Position = UDim2.new(1, -110, 0.5, -25)
  18. decreaseButton.Size = UDim2.new(0, 100, 0, 50)
  19. decreaseButton.Text = "↓"
  20.  
  21. gravityLabel.Parent = ScreenGui
  22. gravityLabel.Position = UDim2.new(1, -110, 0.5, -125)
  23. gravityLabel.Size = UDim2.new(0, 100, 0, 50)
  24. gravityLabel.BackgroundColor3 = Color3.fromRGB(0,255,255)
  25. gravityLabel.TextColor3 = Color3.fromRGB(0,0,0)
  26. gravityLabel.Text = "重力: " .. tostring(workspace.Gravity)
  27.  
  28. toggleButton.Parent = ScreenGui
  29. toggleButton.Position = UDim2.new(1, -110, 0, 10)
  30. toggleButton.Size = UDim2.new(0, 50, 0, 25)
  31. toggleButton.BackgroundColor3 = Color3.fromRGB(255,0,0)
  32. toggleButton.TextColor3 = Color3.fromRGB(255,255,255)
  33. toggleButton.Text = "閉じる"
  34.  
  35. increaseButton.MouseButton1Click:Connect(function()
  36. workspace.Gravity = workspace.Gravity + 10
  37. gravityLabel.Text = "重力: " .. tostring(workspace.Gravity)
  38. end)
  39.  
  40. decreaseButton.MouseButton1Click:Connect(function()
  41. workspace.Gravity = workspace.Gravity - 10
  42. gravityLabel.Text = "重力: " .. tostring(workspace.Gravity)
  43. end)
  44.  
  45. toggleButton.MouseButton1Click:Connect(function()
  46. increaseButton.Visible = not increaseButton.Visible
  47. decreaseButton.Visible = not decreaseButton.Visible
  48. gravityLabel.Visible = not gravityLabel.Visible
  49. end)
  50.  
  51. -- スクリプトが起動したときに通知を表示
  52. game.StarterGui:SetCore("SendNotification", {
  53. Title = "スクリプト起動";
  54. Text = "akuma所属友猫作";
  55. Duration = 5;
  56. })
Advertisement
Add Comment
Please, Sign In to add comment