Advertisement
ou1z

functions

Jul 11th, 2020
1,628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.94 KB | None | 0 0
  1. local getrenv = getrenv
  2.  
  3. getrenv().randomString = function(length)
  4.     local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-={}|[]`~'
  5.     local randomString = ''
  6.    
  7.     math.randomseed(tick())
  8.    
  9.     local charTable = {}
  10.     for c in chars:gmatch"." do
  11.         table.insert(charTable, c)
  12.     end
  13.    
  14.     for i = 1, length do
  15.         randomString = randomString .. charTable[math.random(1, #charTable)]
  16.     end
  17.    
  18.     return randomString
  19. end
  20.  
  21. getrenv().getCharacterPosition = function()
  22.     return game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  23. end
  24.  
  25. getrenv().teleportToPosition = function(position)
  26.     game.Players.LocalPlayer.Character.HumanoidRootPart.Position = position
  27. end
  28.  
  29. getrenv().getURLData = function(url)
  30.     local json = game:HttpGet(url)
  31.     local lua = game:GetService('HttpService'):JSONDecode(json)
  32.     return lua
  33. end
  34.  
  35. getrenv().executeRawUrl = function(url)
  36.     loadstring(game:HttpGet(url))()
  37. end
  38.  
  39. getrenv().randomNumberBetweenRange = function(t,k)
  40.     return math.random(t,k)
  41. end
  42.  
  43. getrenv().isProperty = function(object, property)
  44.     if object[property] then
  45.         return true
  46.     end
  47.     return false   
  48. end
  49.  
  50. getrenv().getProperties = function(object)
  51.     local ClassProperties do
  52.         ClassProperties = {}
  53.         local HttpService = game:GetService("HttpService")
  54.    
  55.         local Data = HttpService:JSONDecode(game:HttpGet("https://pastebin.com/raw/rr431Jm7"))
  56.    
  57.         for i = 1, #Data do
  58.             local Table = Data[i]
  59.             local Type = Table.type
  60.    
  61.             if Type == "Class" then
  62.                 local ClassData = {}
  63.    
  64.                 local Superclass = ClassProperties[Table.Superclass]
  65.    
  66.                 if Superclass then
  67.                     for j = 1, #Superclass do
  68.                         ClassData[j] = Superclass[j]
  69.                     end
  70.                 end
  71.    
  72.                 ClassProperties[Table.Name] = ClassData
  73.             elseif Type == "Property" then
  74.                 if not next(Table.tags) then
  75.                     local Class = ClassProperties[Table.Class]
  76.                     local Property = Table.Name
  77.                     local Inserted
  78.    
  79.                     for j = 1, #Class do
  80.                         if Property < Class[j] then
  81.                             Inserted = true
  82.                             table.insert(Class, j, Property)
  83.                             break
  84.                         end
  85.                     end
  86.    
  87.                     if not Inserted then
  88.                         table.insert(Class, Property)
  89.                     end
  90.                 end
  91.             elseif Type == "Function" then
  92.             elseif Type == "YieldFunction" then
  93.             elseif Type == "Event" then
  94.             elseif Type == "Callback" then
  95.             elseif Type == "Enum" then
  96.             elseif Type == "EnumItem" then
  97.             end
  98.         end
  99.     end
  100.     return ClassProperties[object]
  101. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement