-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local remotes = TS.import(script, script.Parent.Parent.Parent, "remotes").remotes local _utilities = TS.import(script, script.Parent.Parent.Parent, "utilities") local IsClient = _utilities.IsClient local logAssert = _utilities.logAssert --* @internal local ACTION_GUARD_FAILED = "__ACTION_GUARD_FAILED" --* @internal local PLAYER_NOT_CONNECTED = "__PLAYER_NOT_CONNECTED" local SharedRemoteAction do SharedRemoteAction = setmetatable({}, { __tostring = function() return "SharedRemoteAction" end, }) SharedRemoteAction.__index = SharedRemoteAction function SharedRemoteAction.new(...) local self = setmetatable({}, SharedRemoteAction) return self:constructor(...) or self end function SharedRemoteAction:constructor(guard) self.Identifier = SharedRemoteAction.RemoteFunctionIndefinitely self.guard = guard local mt = getmetatable(self) mt.__call = function(context, ...) local args = { ... } return context:Invoke(unpack(args)) end end function SharedRemoteAction:Indefinitely(obj) return obj.Identifier == SharedRemoteAction.RemoteFunctionIndefinitely end function SharedRemoteAction:Destroy() end function SharedRemoteAction:GetCallback() return self.callback end function SharedRemoteAction:OnRequest(callback) self.callback = callback end SharedRemoteAction.Invoke = TS.async(function(self, ...) local args = { ... } logAssert(IsClient, "Function can't be invoked on server") if not self.componentReferense:GetIsConnected() then error(`Component with id {self.componentReferense:GenerateInfo().InstanceId} not connected`) end local result = TS.await(remotes._shared_component_remote_function_Server(self.componentReferense:GetID(), self.name, args)) logAssert(result ~= PLAYER_NOT_CONNECTED, `Component with id {self.componentReferense:GenerateInfo().InstanceId} not connected`) logAssert(result ~= ACTION_GUARD_FAILED, "Guard failed") return result end) function SharedRemoteAction:GetGuard() return self.guard end SharedRemoteAction.RemoteFunctionIndefinitely = "__SHARED_COMPONENT_REMOTE_FUNCTION" end return { ACTION_GUARD_FAILED = ACTION_GUARD_FAILED, PLAYER_NOT_CONNECTED = PLAYER_NOT_CONNECTED, SharedRemoteAction = SharedRemoteAction, }