Is this better? Showing a example of killing parts?
for _,vKillParts in ipairs(game:GetService("Workspace").MainGame.Stages.KillParts:GetChildren()) do
vKillParts.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player then
if not KillsDebounces[Player.Name].Debounce then
KillsDebounces[Player.Name].Debounce = false
hit.Parent:FindFirstChild("Humanoid").Health = 0
task.wait(0.2)
if hit.Parent:FindFirstChild("Humanoid") then
KillsDebounces[Player.Name].Debounce = false
end
end
end
end
end)
end
I’m still trying to figure out the issue myself, I contacted roblox support about this and they keep saying to restart my pc like that will help they are useless so I done this I thought I am just being dumb or something I’ve been trying to fix this for 2-3 days straight
I don’t really know what’s going on either, all I know is that FindFirstChild can sometimes cause lag when used a lot, so if there are lots of events and they are constantly being fired, it could be linked to that? Unlikely though
Man I’ve tried a TUN of stuff, I’ve tried just server and client TO server and same results. but I remember someone telling me about findfirstchild can make lag before. I’ve just tried doing waitforchild instead of findfirstchild and it just gave me a bunch of warnings.
You’re looping through the entire workspace with this script. Maybe try making a killscript to detect when the parent is touched and add that to every kill part? If this only runs once then something else in your code must be the issue causing the ping.
Are you making sure to clean everything up when a player leaves and just in general removing unnecessary objects / indexes? This might be a memory leak.