Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

LegitModule

7GrandDadPGN edited this page Dec 21, 2024 · 1 revision

LegitModule

Example

Note

Creating a legit module will automatically remove modules with the same name.

local Atmosphere
Atmosphere = vape.Legit:CreateModule({
	Name = 'Atmosphere',
	Function = function(callback)
		print(callback, 'module state')
		Atmosphere:Clean(Instance.new('Part'))
		repeat
			print('repeat loop!')
			task.wait(1)
		until (not Atmosphere.Enabled)
	end,
	Size = UDim2.fromOffset(100, 41),
	Tooltip = 'This is a test legit module.'
})

Parameters

Name Type Required Description
Name string Yes The name used for the Module
Size UDim2 No The size of the overlay render frame, this will create a children frame to put objects in if defined
Legit Overlay
Size = UDim2.fromOffset(100, 41)
Function function Yes A function that is called when the module is toggled
(automatically task.spawn's the called function for loops)
Function = function(callback) print(callback, 'module state') end
Tooltip string No A tooltip explaining what the component does
Legit Tooltip
Tooltip = 'Hi! This is a tooltip.'

Methods

Name Returns Description Example
Toggle None Sets the state to the opposite of the current state Atmosphere:Toggle()
Clean None A garbage clone of maid used to clean up connections & Instances when the module state is set to false, use this inside of the callback Atmosphere:Clean(Instance.new('Part')); Atmosphere:Clean(game.Loaded:Connect(function() end))

Properties

Name Type Description
Enabled boolean The current module state
Atmosphere.Enabled
Children Instance A frame that's created for gui objects IF the size parameter is specified
Object Instance Returns the toggle object that displays onscreen
component.Object
Clone this wiki locally