Is there a way to delay the "Touched" event?
Read this post from the RBXDev First:
https://devforum.roblox.com/t/repro-touched-events-delayed/38118
Touched event in parts will cause lag when they collide and get fired multiple times. Causing the server's late respondent.
Like this script inside an NPC:
01 | local NPC = script.Parent |
02 | local RootPart = NPC.HumanoidRootPart |
04 | RootPart.Touched:connect( function (part) |
05 | if not part.Parent then return end |
06 | if not part.Parent:FindFirstChild( 'Humanoid' ) then return end |
07 | local char = part.Parent |
08 | local hum = char.Humanoid |
09 | print ( 'It is a player!' ) |
In-game the player touches the NPC. The server performance goes 30% down and the script printed 50x times.
But is there a way that make this still possible? If then, how?