mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 15:10:03 +00:00
1.0.6
This commit is contained in:
parent
8cad93f2f5
commit
f5bb1df4b0
6 changed files with 30 additions and 2 deletions
BIN
Warp.rbxm
BIN
Warp.rbxm
Binary file not shown.
|
@ -150,6 +150,24 @@ Remote:Fires(true, "Hello World!")
|
|||
```
|
||||
:::
|
||||
|
||||
## `:FireExcept` <Badge type="tip" text="Server Only" />
|
||||
|
||||
Fire the event to all clients but except a players.
|
||||
|
||||
::: code-group
|
||||
```lua [Variable]
|
||||
(
|
||||
reliable: boolean,
|
||||
except: { Player },
|
||||
...: any
|
||||
)
|
||||
```
|
||||
|
||||
```lua [Example]
|
||||
Remote:FireExcept(true, { Players.Eternity_Devs, Players.Player2 }, "Hello World!") -- this will sent to all players except { Players.Eternity_Devs, Players.Player2 }.
|
||||
```
|
||||
:::
|
||||
|
||||
## `:Invoke` <Badge type="warning" text="yield" />
|
||||
|
||||
Semiliar to `:InvokeClient`, its for Invoke to a client.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
--!strict
|
||||
--!native
|
||||
local Client = {}
|
||||
Client.__index = Client
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
--!strict
|
||||
--!native
|
||||
local Server = {}
|
||||
Server.__index = Server
|
||||
|
||||
|
@ -29,6 +30,13 @@ function Server:Fires(reliable: boolean, ...: any)
|
|||
end
|
||||
end
|
||||
|
||||
function Server:FireExcept(reliable: boolean, except: { Player }, ...: any)
|
||||
for _, player: Player in ipairs(Players:GetPlayers()) do
|
||||
if table.find(except, player) then continue end
|
||||
ServerProcess.insertQueue(self.id, reliable, player, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function Server:Invoke(timeout: number, player: Player, ...: any): any
|
||||
return ServerProcess.insertRequest(self.id, timeout, player, ...)
|
||||
end
|
||||
|
|
|
@ -55,7 +55,8 @@ local function initializeEachPlayer(player: Player)
|
|||
if not queueOut[player] then
|
||||
queueOut[player] = {}
|
||||
end
|
||||
for Identifier: string,_ in serverQueue do
|
||||
for Identifier: string in serverQueue do
|
||||
if not player then break end
|
||||
if not queueOut[player][Identifier] then
|
||||
queueOut[player][Identifier] = {}
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
-- Warp Library (@Eternity_Devs)
|
||||
-- version 1.0.5
|
||||
-- version 1.0.6
|
||||
--!strict
|
||||
--!native
|
||||
local Index = require(script.Index)
|
||||
|
|
Loading…
Reference in a new issue