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

Module

Example

Note

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

local SilentAim
SilentAim = vape.Categories.Combat:CreateModule({
	Name = 'SilentAim',
	Function = function(callback)
		print(callback, 'module state')
		SilentAim:Clean(Instance.new('Part'))
		repeat
			print('repeat loop!')
			task.wait(1)
		until (not SilentAim.Enabled)
	end,
	ExtraText = function() return 'Test' end,
	Tooltip = 'This is a test module.'
})

Parameters

Name Type Required Description
Name string Yes The name used for the Module
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
Tooltip
Tooltip = 'Hi! This is a tooltip.'
ExtraText function No The returned string shows up in the Text GUI ovelay.
(this will only update when vape:TextGUIUpdate() is called)
ExtraText
ExtraText = function() return 'Test' end

Methods

Name Returns Description Example
Toggle None Sets the state to the opposite of the current state SilentAim:Toggle()
SetBind None Sets the current module bind to the provided parameter SilentAim:SetBind('G')
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 SilentAim:Clean(Instance.new('Part')); SilentAim:Clean(game.Loaded:Connect(function() end))

Properties

Name Type Description
Enabled boolean The current module state
SilentAim.Enabled
Bind string / table The current bind of the module
(table's are used to store binds on mobile)
SilentAim.Bind
Object Instance Returns the module button object that displays onscreen
component.Object
Clone this wiki locally