API / READ ME
EDIT (PSA) So the performance of this module isnt as well compared to all the others i dont recomend using this anymore!
This is a remake of Tyridge77’s network because it is no longer in service and said not to be updated.
By: Flipitagainpls
My friend and I are both scripters and we’re creating a game and Tyridge’s Network was always our go-to. When we were scripting, we kept coming across this one error and neither of us could find out how to fix it, so my friend recommended we create our own instead of fixing a script that wasn’t made by us.
Features: if 1 single event gets fired more than 6 times it will stop all 6 of them and clear the queue,
unreliable events are added for cases where a regular event is not needed,
and all events are created on server when the game starts meaning you will need to have your bindevents function made or else you will get many errors lol.
This module also contains a system whereas each event has a queue that gets removed each time the event is fired. Since the queue ends so quickly, we also built in a second rapid firing system for exploiting or whatever that stops the event when the queue has over 6 attempts.
Recommended: For good performance use 1 event for one occasion as they stop and have debounces or use our fast fire events that don’t have debounces or stops!
NOTE: events cannot have the same name of any type, events also debounce for 2 seconds to prevent rapid firing
Here is the model: Network
Tutorials
-- bind events method
-- client
local Network = require(network location)
Network:FireServer('TestEvent', 'Any string')
-- server
Network:BindEvents({
TestEvent = function(Player, myString)
print(myString)
end,
})
-- prints: 'Any string'
-- bind events method works with any events exept unreliable
-- bind functions method
-- client
local Network = require(network location)
local test = Network:InvokeServer('TestEvent', 'Any string')
if test then
print('hi')
end
-- server
Network:BindFunctions({
TestEvent = function(Player, myString)
return true
end,
})
-- prints: 'hi' if the server returns true
-- bind functions method works with any remotefunction
-- Bind Unreliable Events method
-- client
local Network = require(network location)
Network:FireUnreliableEventServer('TestEvent', 'Any string')
-- server
Network:BindUnreliableEvents({
TestEvent = function(Player, myString)
print(myString)
end,
})
-- prints: 'Any string'
-- Bind Unreliable Events method works with any unreliable event
Official API for this Module
Network:FireServer(Name, ...)
Network:InvokeServer(Name, ...)
Network:FireUnreliableEventServer(Name, ...)
Network:FireClient(Player, Name, ...)
Network:InvokeClient(Name, ...)
Network:FireAllClients(Name, ...)
Network:FireAllClientsWithinDistance(Name, position, distance, ...)
Network:FireUnreliableEventClient(Player, Name, ...)
-- handlers
Network:BindEvents({eventName = function() end,})
Network:BindFunctions({eventName = function() end,})
Network:BindUnreliableEvents({eventName = function() end,})
Now, when i first started scripting there were cases where i needed to repeatedly fire an event but with our security you cant do that that is why we made FastFiring remote events and remote functions. These events are unprotected by our security and is handled like a basic
remote event.
Network:FastFireServer(...)
Network:FastFireClient(Player, ...)
Network:FastInvokeServer(...)
Network:FastInvokeClient(Player, ...)
Please update me on any errors so I can fix them fastly!
UPDATES
- this will be the official Update pannel for this module