Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is there slight lag in my script? Part touches but takes a bit to register.

script.Parent.Touched:Connect(function(Hit)
	if Hit.Name ~= "Part" then
	for i = 1, 10 do
		local ExpPart = Instance.new("Part",workspace)
		ExpPart.Size = Vector3.new(2,2,2)
		ExpPart.Position = script.Parent.Position
		ExpPart.Velocity = Vector3.new(math.random(20, 50), math.random(30,100),math.random(20,50)) 
		ExpPart.CanCollide = false
		ExpPart.Material = Enum.Material.Slate
	 	end
	script.Parent:Destroy()
	end
end)

What happens is, all the parts stay in the center for around 200 ms, then they fly with their velocity. How do I lower that delay?

2 comments

0

It's called ping, you can solve this by getting faster internet.

0

Then explain, let's say adventure story, has the same concept, but has their calculate in the matter of 50- 100 ms? I still use the same internet.

1 answer

I think it's a for i = 1, 10 do issue i have had the problem as well. Sorry i can't fix.

This discussion is preserved as it was. New answers, comments, and votes are closed.