your model is great good job but there are some lines of code that can be optimized
Local Script
local cmd
--[[
for _,v in pairs(game:GetDescendants()) do -- you are checking for every descendant in the game to get the model which isnot good if there are alot of Descendants in the game
if v:IsA("Model") then
local funfound = false
for _, fun in pairs(v:GetChildren()) do -- that is uncessary
if fun.Name == "Functionality" and fun:IsA("Folder") then
funfound = true
end
end
if funfound == true then
cmd = v.Model.FRONT.SCREEN.ui.cmd
found = true
end
end
end
]]
-- can be simplified by using tags into just 2 lines
local Tab = game:GetService("CollectionService"):GetTagged("Tab")[1]
cmd = Tab.Model.FRONT.SCREEN.ui.cmd
---
server
your server script is good but its better to use task.wait() instead of wait so it doesnot throttle and because wait runs on 30hz which means its less accurate
module
the difference is small but if you donot want to get the key of a table then donot wrap it in pairs