#how can I improve my script (less lag)

1 messages · Page 1 of 1 (latest)

lunar cave
#

This script is supposed to check if a player is inside a region3 zone, if they are inside a region3 they will call an event to a local script which will change the lighting for that specific player and if the player is not found after being found it will send call another event that will just be the same as the last local script just the lighting will be different (just different numbers) this script is running in a hearthbeat is there any way to minimize the lag that hearthbeat can cause or a better way to run the script

#

this is the script that runs after event1 is fired

lunar cave
#

how can I improve my script (less lag)

sand glen
#

.Touched

proven finch
#

just make a part call it region3

#

and do

part.Touched:Connect(function(hit)
  if hit.Parent:FindFIrstChild("Humanoid") then
      local plr  = hit.Parent
       -- code here with plr ref
  end
)
lunar cave