Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------
- --module script
- ---------------------------------------------------
- local _Instance = {}
- function _Instance.Create(ClassName)
- --attempt to create a new instance
- local success, errorMessage = pcall(function()
- local newInstance = Instance.new(ClassName)
- end)
- --if we failed to create an instance of ClassName, return an error message
- if(not success)then
- error(errorMessage)
- return
- end
- --if we got this far, we created an instance without failiure, so return that instance.
- return newInstance
- end
- return _Instance
- ---------------------------------------------------
- --normal script:
- ---------------------------------------------------
- module = require(game.ReplicatedStorage.InstanceModule)
- module.Create('Part') =
- Part.CanCollide = false
- Part.Position = Vector3.new(x,y,z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement