You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to let the local script know that the event they fired was received
What is the issue? Include screenshots / videos if possible!
i thought maybe to use a bool to use as an indicator that it was received but i fear there will be latency when the bool changes and is replicated to the client??
I would just like to know if there are other ways to go about this
simple, just fire the remoteEvent once in both the server and the client, setup a debounce in the client side which sets to true when (e.g lunge a sword) and then sets back to false when it receives from the server. here’s a code exmaple:
client:
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local tool = script.Parent
local db = false
tool.Activated:Connect(function()
if db then return end
db = true
event:FireServer("info")
end)
event.OnClientEvent:Connect(function()
db = false
end)
server:
local cooldown = 2
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, information)
-- whatever you want to do in the server side
task.wait(cooldown)
game.ReplicatedStorage.RemoteEvent:FireClient(plr)
end)
dam i forgot about that, its pretty simple you just do the debounce on the server too
local dbs = {}
local cooldown = 2
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, information)
if dbs[plr.UserId] then return end
dbs[plr.UserId] = true
-- whatever you want to do in the server side
task.wait(cooldown)
dbs[plr.UserId] = nil
game.ReplicatedStorage.RemoteEvent:FireClient(plr)
end)