It might sound like a dumb question to ask but I just want to be 100% sure on this information does child.added/child.removed have a latency delay?
For example, let’s if I were to instance a BoolValue
and name it Test and parent it to the player’s character and the players ping began to spike. Would there be a delay for the child added function or would it register the second the instances is added to the character. I’m 99% sure it would be instant with no latency delay as the child added function is called from the player client but I want to be 100% sure. Below is an example of code that refers to this situation.
-- Server Script
local PhysicsService = game:GetService("PhysicsService")
PlayerService.PlayerAdded:Connect(function(Player)
repeat task.wait() until Player
Player.CharacterAdded:Connect(function(Character)
repeat task.wait() until Character.Humanoid
local Character = Player.Character
local BoolValue = Instance.new("BoolValue")
BoolValue.Parent = Character
BoolValue.Name = "Test"
end)
end)
-- Local Script
local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
Character.ChildAdded:Connect(function(Child)
if Child.Name == "Test" then
print("Delay ?")
end
end)