https://education.roblox.com/ko-kr/resources/intro-to-module-scripts
https://developer.roblox.com/en-us/api-reference/class/ModuleScript
- Module Script
```
-- Tables are store multiple values in one variable
local module= {}
-- Add a few functions to the table
module.foo= function()
print("Foo!")
end
function module.bar()
print("Bar!")
end
function module.print(para)
print(para)
end
return module
```
- Usage
```
-- The require function is provided a ModuleScript, then runs
-- the code, waiting until it returns a singular value.
local my_functions = require(script.Parent.ModuleScript)
-- These are some dummy functions defined in another code sample
my_functions.foo()
my_functions.bar()
my_functions.print("string")
```
Module Script Functions | Roblox Scripting Tutorial
Roblox How to Script for Beginners : ModuleScripts
How To Use ModuleScripts In Roblox Studio - Advanced Tutorial #1
ModuleScript Basics | 2 Minute Scripting 📜
'tech > game' 카테고리의 다른 글
21/08/02 Roblox Studio Tutorial: How to Save Data (0) | 2021.08.02 |
---|---|
21/08/02 “502: API Services rejected request with error. HTTP 403 (Forbidden)” (0) | 2021.08.02 |
21/08/02 Pcalls - When and how to use them (0) | 2021.08.02 |
21/08/02 How to build a water slide in ROBLOX 2020 Easy! (0) | 2021.08.02 |
21/08/01 HOW TO MAKE YOUR OWN SKYBOX (CUBEMAP) IN ROBLOX STUDIO (0) | 2021.08.01 |