mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 23:01:53 +00:00
Tag removal and new serverside structure
This commit is contained in:
@@ -12,15 +12,16 @@ export type KeyBindMap = {
|
||||
[Enum.KeyCode]: (KeyPressed: Enum.KeyCode) -> ()
|
||||
}
|
||||
}
|
||||
export type InputBegan = RBXScriptConnection
|
||||
export type InputEnded = RBXScriptConnection
|
||||
type CallbackFunction = () -> ()
|
||||
type BindConstructor = {
|
||||
BindMap: KeyBindMap,
|
||||
InputBegan: InputBegan,
|
||||
InputEnded: InputEnded
|
||||
}
|
||||
|
||||
export type InputBegan = RBXScriptConnection
|
||||
export type InputEnded = RBXScriptConnection
|
||||
type CallbackFunction = (KeyPressed: Enum.KeyCode) -> ()
|
||||
|
||||
local UIS = game:GetService("UserInputService")
|
||||
|
||||
function BindLink.constructor(gameProcessing: boolean) --Allow multiple bindings of the same keys, no overwrites
|
||||
|
||||
@@ -2,17 +2,44 @@
|
||||
--!native
|
||||
--!strict
|
||||
|
||||
local Tags = {}
|
||||
Tags.__index = Tags
|
||||
|
||||
local CS = game:GetService("CollectionService")
|
||||
|
||||
local exports: {[string]: Instance} = {}
|
||||
type ExportedTags = {
|
||||
[string]: Instance | {Instance}
|
||||
}
|
||||
|
||||
local AllTags = CS:GetAllTags()
|
||||
for i = 1, #AllTags do
|
||||
local TagName = AllTags[i]
|
||||
if TagName ~= "RopeMasterObject" and TagName ~= "ServerGuard_Physics" then
|
||||
local Tagged = CS:GetTagged(TagName)
|
||||
exports[TagName] = #Tagged>1 and Tagged or Tagged[1]
|
||||
function Tags.constructor()
|
||||
local Exports: ExportedTags = {}
|
||||
local AllTags = CS:GetAllTags()
|
||||
|
||||
for n: number = 1, #AllTags do
|
||||
local TagName = AllTags[n]
|
||||
if TagName ~= "RopeMasterObject" and TagName ~= "ServerGuard_Physics" then
|
||||
local Tagged = CS:GetTagged(TagName)
|
||||
Exports[TagName] = #Tagged>1 and Tagged or Tagged[1]
|
||||
end
|
||||
end
|
||||
return setmetatable({
|
||||
Exports = Exports
|
||||
}, Tags)
|
||||
end
|
||||
|
||||
return exports
|
||||
function Tags:Nuke()
|
||||
local Exports = self.Exports
|
||||
|
||||
for i,v in Exports do
|
||||
if type(v) == "table" then
|
||||
for n: number = 1, #v do
|
||||
CS:RemoveTag(v[n], i)
|
||||
end
|
||||
else
|
||||
CS:RemoveTag(v, i)
|
||||
end
|
||||
end
|
||||
warn("☢️ nuked all in-game tags. Left-over tags="..table.concat(CS:GetAllTags(), ", "))
|
||||
end
|
||||
|
||||
return Tags
|
||||
Reference in New Issue
Block a user