Coder Social home page Coder Social logo

custommethods's Introduction

Custom Methods

Create custom functionalities on Roblox Objects! Using methods.

QuickStart

Motivations

I made this because I wanted to create a recreation of the MT_Api made by rain back in 2017 linked here.

How to use

To use CustomMethods Copy this and Paste it on top of your script.

local CustomMethods = loadstring(game:HttpGet('https://raw.githubusercontent.com/Perthys/CustomMethods/main/main.lua'))()

We are going to make a simple method globally called :PrintFullName() using the CreateGlobalMethod() function.

local Namecall = CustomNameCalls:CreateGlobalMethod(":PrintOutFullName()", function(self, ...) -- Please Note : and () are optional and you can use the direct name.
    return print(self:GetFullName())
end)

-- This method will now work for every single object in the game.

game.Players.LocalPlayer:PrintOutFullName() -- Output: Players.AltAccountReal

It's that simple!

How To Remove

You can easily remove the method by calling the returned function.

local Namecall = CustomNameCalls:CreateGlobalMethod(":PrintOutFullName()", function(self, ...)
    return print(self:GetFullName())
end)

Namecall()

game.Players.LocalPlayer:PrintOutFullName() -- Output: nil

Creating Methods for specific Instances

You can also create methods for Specific Instances with the CreateInstanceMethod() function

local Namecall_2 = CustomNameCalls:CreateInstanceMethod(game.Players, "Hello", function()
    return "Goodbye"
end)

print(game.Players:Hello()) -- Output: Goodbye

custommethods's People

Contributors

perthys avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.