Skip to content
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.

Quantum-Science-Inc/script-repository

Repository files navigation

script-repository

Main LUA Script Repository for QS

Env.lua

EXAMPLE SCRIPT

--// Establish your variable table
local Env = {
	Debounce = false;
}

--// Set the script env
--// USE >>> require(game:GetService("ServerScriptService").Server.Modules.Env)(TABLEOFVARIABLESHERE)
require(game:GetService("ServerScriptService").Server.Modules.Env)(Env)

--// Ignore this error, it will not error in the script when it runs
if Debounce == false then
	print("Nice we didn't error cause it sets the global Env above in the require")
end

--// Settings the Env allows you to set the Variables outside the script like so
local BindableEvent = Instance.new("BindableEvent")
BindableEvent.Name = "TestingBindable"

--// Allows you to change variables outside the script
BindableEvent.Event:Connect(function(IndexOfVariable, ValueToChange)
	Env[IndexOfVariable] = ValueToChange
end)

BindableEvent.Parent = game:GetService("ServerStorage")

--// To reset the script upon regen call this and MAKE SURE TO CALL IT AS A FUNCTION
RESETSCRIPTENV()

About

Main LUA Script Repository for QS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages