Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. ---------------------------------------------------
  2. --module script
  3. ---------------------------------------------------
  4. local _Instance = {}
  5.  
  6. function _Instance.Create(ClassName)    
  7.    
  8.     --attempt to create a new instance
  9.      local success, errorMessage = pcall(function()
  10.         local newInstance = Instance.new(ClassName)
  11.     end)
  12.    
  13.     --if we failed to create an instance of ClassName, return an error message
  14.     if(not success)then
  15.         error(errorMessage)
  16.         return
  17.     end
  18.    
  19.     --if we got this far, we created an instance without failiure, so return that instance.
  20.     return newInstance
  21. end
  22.  
  23.  
  24. return _Instance
  25.  
  26. ---------------------------------------------------
  27. --normal script:
  28. ---------------------------------------------------
  29. module = require(game.ReplicatedStorage.InstanceModule)
  30.  
  31. module.Create('Part') =
  32. Part.CanCollide = false
  33. Part.Position = Vector3.new(x,y,z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement