Advertisement
mjv2023

subspace tripmine gui

Aug 21st, 2023
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. -- Create a ScreenGui to hold the button
  2. local gui = Instance.new("ScreenGui")
  3. gui.Name = "MainGui"
  4. gui.Parent = game.Players.LocalPlayer.PlayerGui
  5.  
  6. -- Create the button
  7. local button = Instance.new("TextButton")
  8. button.Name = "ExecuteButton"
  9. button.Size = UDim2.new(0, 200, 0, 50)
  10. button.Position = UDim2.new(0.5, -100, 0.5, -25)
  11. button.Text = "Click me to execute code"
  12. button.Parent = gui
  13.  
  14. -- Function to execute when the button is clicked
  15. local function executeCode()
  16. -- Close all existing GUIs
  17. for _, child in ipairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
  18. if child:IsA("ScreenGui") and child.Name ~= "MainGui" then
  19. child:Destroy()
  20. end
  21. end
  22.  
  23. -- Insert the provided code here
  24. local Players = game:GetService("Players")
  25. local Equipped = false
  26. local Plr = Players.LocalPlayer
  27. local Char = Plr.Character or Plr.CharacterAdded:Wait()
  28. local Hum = Char:WaitForChild("Humanoid")
  29. local Root = Char:WaitForChild("HumanoidRootPart")
  30. local RightArm = Char:WaitForChild("RightUpperArm")
  31. local LeftArm = Char:WaitForChild("LeftUpperArm")
  32. local RightC1 = RightArm.RightShoulder.C1
  33. local LeftC1 = LeftArm.LeftShoulder.C1
  34.  
  35. local tool = Instance.new("Tool")
  36. tool.TextureId = "http://www.roblox.com/asset/?id=11987521"
  37. tool.Name = "SubspaceTripmine"
  38. tool.Parent = game.Players.LocalPlayer:WaitForChild("Backpack")
  39.  
  40. -- Rest of the provided code
  41.  
  42. setupHands(tool)
  43. end
  44.  
  45. -- Connect the button's Click event to the executeCode function
  46. button.MouseButton1Click:Connect(executeCode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement