Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function CreateService(obj)
- local service = {}
- for _,v in pairs(obj:GetChildren()) do
- if v:IsA("RemoteFunction") then
- service[v.Name] = function (...)
- v:InvokeServer(...)
- end
- elseif v:IsA("RemoteEvent") then
- service[v.Name] = v.OnClientEvent
- elseif string.find(v.ClassName,"Value") then
- service[v.Name] = v.Value
- v.Changed:connect(function ()
- service[v.Name] = v.Value
- end)
- end
- end
- return service
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement