ELS Module [0.0.1]

PRC Developer ELS Module

This is a module for PRC Developers

local ELS = require(7131336705):FetchVersion(LatestVersion) -- If left blank will automatically return the latest version

Date Created - 7/21/2021

Last Updated - 7/21/2021

Latest Version - 0.0.1


This Module Is not made for Reselling or Intended for Commerical use.
I’ve spent a lot of time creating this Module so please do not claim it as yours


Core Functions

IsOnline - Returns true if the module is online.

  • Version Added - 0.0.1
  • Deprecated - False
  • Yields - false

This value will usually always return true as the module will rarely be disabled.

FetchVersion - Returns Module Accosiated with that Version

  • Version Added - 0.0.1
  • Deprecated - False
  • Yields - false

IF the version does not exist or has been deleted it will return nil

Reminder | Old versions WILL not be deleted, This will allow you to stay on older versions without worrying about them being removed.


Official Releases

0.0.1

Functions


ReturnVersion - Returns Version associated with the Inital bootup of the Module

  • Version Added - 0.0.1
  • Deprecated - False
  • Yields - false

IsOnStage(Value1, Value2) - Compares the two values determining if the stage is active or not.

  • Version Added - 0.0.1
  • Deprecated - False
  • Yields - false
if ELS:IsOnStage(1, 1) == false then -- Returns true
	return false 
end

if ELS:IsOnStage(3, 1) == false then -- Returns false
	return false 
end

If Arg[1] does not equal to Arg[2] it will return false
If Arg[1] does equal Arg[2] it will return true


StageRepeat(NumberOfTimesToRepeat, UniqueName, function) - Repeats the associated function the number of times you gave it.

  • Version Added - 0.0.1
  • Deprecated - False
  • Yields - true
StageRepeat(10, "Stage1_1", function()
	warn("prints 10 times")
end)

Intended Usage

local MainVeh = -- Path to your Light Values
local Lights = -- Path to your Lights
local ELS = require(7131336705):FetchVersion(LatestVersion)
local Global = {}

Global.Stage1 = function()
	ELS:StageRepeat(10, "Stage1_1", function()

	end)	
end

Global.Stage2 = function()
	ELS:StageRepeat(10, "Stage2_1", function()

	end)	
end

Global.Stage3 = function() -- If you were to have multiple Repeats
	ELS:StageRepeat(20, "Stage3_1", function()	-- Repeats 20 times
		if ELS:IsOnStage(3, 3) == false then -- Returns true, If returned false it will discontinue the thread and run the next thread it was told
			return false 
		end
	end)

	ELS:StageRepeat(10, "Stage3_2", function()		

	end)

	ELS:StageRepeat(5, "Stage3_3", function() -- Repeats 5 times	

	end)
end

Global.DisableLights = function()
--[[
Your usual shutdown function for turning off lights after a pattern
]]
end

MainVeh.ELS.Changed:Connect(function()
	if MainVeh.ELS.Value == 1 then
		repeat
			wait()
			Global.Stage1()
		until MainVeh.ELS.Value ~= 1
	elseif MainVeh.ELS.Value == 2 then
		repeat
			wait()
			Global.Stage2()
		until MainVeh.ELS.Value ~= 2
	elseif MainVeh.ELS.Value == 3 then -- Waits until the value is on Stage 3
		repeat
			wait()
			Global.Stage3()
		until MainVeh.ELS.Value ~= 3 -- Will constantly repeat the function until it is changed to another function or disabled
	else
		repeat
			wait()
			Global.DisableLights()	
		until MainVeh.ELS.Value ~= 0
	end
end)

Global.DisableLights() -- Disables your lights by default as it doesn't run on a loop.