Advertisement
Dodikman

Steve's one piece cmds

Jul 7th, 2019
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local plrGui = plr.PlayerGui
  3. local prefix = ':'
  4.  
  5. function getAllTools()
  6.     if plrGui:FindFirstChild('tempGui') then
  7.         plrGui.tempGui:Remove()
  8.     end
  9.    
  10.     local tempGui = Instance.new('ScreenGui')
  11.     tempGui.Name = 'tempGui'
  12.     tempGui.Parent = plrGui
  13.    
  14.     local xShift = 0.2
  15.     local yShift = 0.5
  16.    
  17.     local closeButton = Instance.new('TextButton')
  18.     closeButton.TextColor3 = Color3.new(255, 0, 0)
  19.     closeButton.TextScaled = true
  20.     closeButton.Text = 'X'
  21.     closeButton.Size = UDim2.new(0.05, 0, 0.05, 0)
  22.     closeButton.Position = UDim2.new(0.15, 0, 0.45, 0)
  23.     closeButton.BackgroundColor3 = Color3.new(0, 0, 0)
  24.     closeButton.BackgroundTransparency = 0.5
  25.     closeButton.Parent = tempGui
  26.    
  27.     closeButton.MouseButton1Click:Connect(function()
  28.         tempGui:Remove()
  29.     end)
  30.    
  31.     for k, v in pairs(game.Workspace:GetChildren()) do
  32.         if v.ClassName == 'Tool' and v:FindFirstChild('Handle') then
  33.             if xShift >= 0.75 then
  34.                 xShift = 0.2
  35.                 yShift = yShift + 0.055
  36.             end
  37.            
  38.             local tempButton = Instance.new('TextButton')
  39.             tempButton.TextColor3 = Color3.new(0, 255, 0)
  40.             tempButton.TextScaled = true
  41.             tempButton.Text = v.Name
  42.             tempButton.Size = UDim2.new(0.15, 0, 0.05, 0)
  43.             tempButton.Position = UDim2.new(xShift, 0, yShift, 0)
  44.             tempButton.BackgroundColor3 = Color3.new(0, 0, 0)
  45.             tempButton.BackgroundTransparency = 0.5
  46.             tempButton.Parent = tempGui
  47.            
  48.             tempButton.MouseButton1Click:Connect(function()
  49.                 if game.Workspace:FindFirstChild(plr.Name) then
  50.                     spawn(function()
  51.                         v.Handle.CFrame = plr.Character.HumanoidRootPart.CFrame
  52.                         tempButton:Remove()
  53.                     end)
  54.                 end
  55.             end)
  56.            
  57.             xShift = xShift + 0.155
  58.         end
  59.     end
  60. end
  61.  
  62. local commands = {
  63.     ['gat'] = {
  64.         ['func'] = getAllTools
  65.     }
  66. }
  67.  
  68. plr.Chatted:Connect(function(msg)
  69.     if string.sub(msg, 1, 1) == prefix then
  70.         local raw = string.lower(string.sub(msg, 2))
  71.         local arguments = {}
  72.        
  73.         for item in string.gmatch(raw, '%w+') do
  74.             table.insert(arguments, item)
  75.         end
  76.        
  77.         if arguments[1] == nil then
  78.             return
  79.         end
  80.        
  81.         local command = arguments[1]
  82.         table.remove(arguments, 1)
  83.  
  84.         if commands[command] ~= nil then
  85.  
  86.             spawn(commands[command]['func'])
  87.         end
  88.     end
  89. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement