pcall have more massive performance over task.spawn (upto 18x faster) here, very weird right where task.spawn supposed to be faster. i might implement pcall and replace task.spawn if there no other issues with using pcall
Without the identifier remoteName being created on the server, this function never runs due to the Serdes module repeatedly waiting. This also yields the entire script, which Iām sure is unintentional behavior.
-- this doing something and dont effect to the bottom yields.
Warp.Client(remoteName):Connect(func) -- yield/wait
-- next lines wont be runned until the yield finish
I got a idea you should add logging and a option to use a thingy āGetClientEventā and āGetServerEventā to connect a event since it will probably be easier to use idk
Now Head to the Index module script located under server
and add this line of code
function getDistance(pos: Vector3, distance: number)
local playersInRange = {}
for _, player in ipairs(Players:GetPlayers()) do
local character = player.Character
if character and character:FindFirstChild('Humanoid') then
local primaryPart = character.PrimaryPart
if primaryPart then
local playerPosition = primaryPart.Position
local playerDistance = (pos - playerPosition).Magnitude
if playerDistance < distance then
table.insert(playersInRange, player)
end
end
end
end
return playersInRange
end
function Server:FiresWithDistance(reliable: boolean, position : Vector3, Distance : number, ...: any)
local PlayersInRange = getDistance(position, Distance)
for _, player: Player in ipairs(PlayersInRange) do
ServerProcess.insertQueue(self.id, reliable, player, ...)
end
end
Example of usage
Warp.Server("Test"):Connect(function(Player : Player)
local Position = Vector3.zero
local Distance = 500
local DataToSend = {
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
}
Warp.Server("Test"):FiresWithDistance(false,Position,Distance,DataToSend)
end)
and if your reading this @Eternity_Devs add this to the next update
documentation & my github repos cant be reached (due flagged account status) so for temporary you can just download with just .RBXM file or use wally package instead, and if you need a help can contact me by reply post/me or private message.