Hi there!
Recently, I have begun work on a souls-like experience. One of the features I have added is a roll, complete with i-frames (invincibility frames). However, I began to wonder if the i-frames will still work if the player has bad wifi.
The way I have it set up is that every time the player wants to roll, they send a remote event to the server, which then, upon receiving it, gives the player a force-field for the duration of the roll animation.
I’m worried that if the player has enough lag, the remote event won’t fire in time for the player to properly receive their i-frames. When dealing with slit second responses, I’m worried this could be a major problem for some unfortunate players.
Is there anything I can do to resolve this issue?
The server script
-- Get roblox services
local Debris = game:GetService("Debris")
-- Get the remote event
local Replicated_Storage = game:GetService("ReplicatedStorage")
local Roll_Event = Replicated_Storage:WaitForChild("Remote_Events").Roll_Events.Request_Roll
Roll_Event.OnServerEvent:Connect(function(Player, Time_to_roll)
local Forcefield = Instance.new("ForceField", Player.Character)
Forcefield.Visible = false
Debris:AddItem(Forcefield, Time_to_roll)
end)