Files
PlaneBuilding/scripts/modules/PartActivationModule.lua
T

15 lines
619 B
Lua

-- module which serves the purpose of providing a universal function so that I can change how checks for whether a player is allowed to activate something works (such as collaborative building)
local module = {}
module.tagService = _G.Tags
function module.activator(realScript,callback)
local clickDetector = realScript.Parent:FindFirstChildWhichIsA("ClickDetector")
clickDetector.MouseClick:Connect(function(player)
if module.tagService:HasTag(realScript.Parent,"P_"..player.UserId) or module.tagService:HasTag(realScript.Parent.Parent,"P_"..player.UserId) then
callback(player)
end
end)
end
return module