Normally, people long for this…
Fear not! Now, you can make quick and easy custom services with variables you can set/get through ATTRIBUTES! You can go even further by scripting something to happen when it changes!
Want to test it out? put this anywhere you would like!
--Service Creation Function
local function CreateService(Name, Attributes)
local Service = Instance.new('Actor')
Service.Name = Name
Service.Parent = game
for i, obj in pairs(Attributes) do
Service:SetAttribute(i, obj)
end
return Service
end
--Usage, Setting up a running object counter
local PartService = CreateService("PartService", {
["GetRunningObjects"] = #workspace:GetDescendants()
})
--Changing the running object counter
game["Run Service"].Heartbeat:Connect(function()
print(PartService:GetAttribute("GetRunningObjects"))
PartService:SetAttribute("GetRunningObjects", #workspace:GetDescendants())
end)
--NOTE: These use attributes.