#how can i reduce lag in this script?

1 messages · Page 1 of 1 (latest)

soft lichen
#

this script is causing lag, how can i make it less laggy

shut path
#

figure out what context onground should be true and only run the logic while that is happening instead of all the time

grizzled remnant
#

LMFAOOO

#

EVERY HEARTBEAT

#

10000 FOR LOOPS

#

BRO CHILL

shut path
#

yeah also dont iterate through the entire workspace every frame

sand rock
#

jesus

hybrid chasm
keen sky
#

what is this even for??

#

:sob

hybrid chasm
#

real

soft lichen
#

It’s for tornado

winged turtleBOT
#

studio** You are now Level 10! **studio

distant saddle
#
while wait() do
if script.Parent.Scripts.OnGround.Value == true then
for i,v in pairs(game.Workspace:GetDescendants()) do
``` lol there's yer problem ![fingerguns](https://cdn.discordapp.com/emojis/867068351242567690.webp?size=128 "fingerguns")
soft lichen
#

you need to expand it

sand rock
#

that is

#

alot of ifs

shut path
#

needs more tbh

#

if script.Parent:FindFirstChild("Settings")

sand rock
#

if script then

shut path
#

real

#

why arent you using collectionservice to just tag stuff that can be picked up and use a hitbox to determine whether things are in tornado range