Services vs Controllers
What is a Service?
Examples:
-- Server-side Service
local Players = game:GetService("Players")
local PlayerService= {}
PlayerService.__index = PlayerService;
function PlayerService:Start()
Players.PlayerAdded:Connect(function(player)
print("Player joined:", player.Name)
end)
end
return PlayerServiceWhy Call Them "Controllers" on the Client?
Best Practices
1. Keep Logic Scoped to the Right Context
2. Name Clearly and Consistently
3. Shared Services Are Powerful
Summary
Concept
Definition
Last updated