#How do i reduce lag when many hitboxes creates?

1 messages · Page 1 of 1 (latest)

brazen knoll
shy cliff
#

Run in Parallel and detect hits using the ZonePlus module which is way more accurate and optimized

brazen knoll
#

ZonePlus module..?

#

alright

#

so i just replace parts in parts with this module? @shy cliff

zone:onItemEnter(item, function()
    print("The item has entered the zone!")
end)
shy cliff
#

yeah that works but they also have their custom way of detecting players

#

but that works too yeah

brazen knoll
#

oooo

#

ok time to replace

#

thank you

shy cliff
#

it's like a function called onPlayerEntered

shy cliff
#

it's called playerEntered and playerExited

brazen knoll
#

alright

#

thanks

shy cliff
#

no problem

brazen knoll
#

@shy cliff i used it now its even more laggier

#

and some things doesn't work

#

ugh

shy cliff
#

did you use the playerEntered function

#

all you have to do is use that and then deal damage to the player if you want it to deal damage

#

you don't have to use get parts in parts INSIDE the playerEntered function

brazen knoll
#

so i don't need playerentered

#

also it lags more

shy cliff
#

i thought you were detecting players

shy cliff
#

It's something you did wrong in your script or maybe you binded it to a heartbeat event

brazen knoll
#

welp alright

brazen knoll
#

alright then

#

i will try again

#

now the hitbox doesn't even work

#

Great

brazen knoll
shy cliff
#

do you make an individual zone for each shard

brazen knoll
#

eevery second as 10 hitboxes for each shard

shy cliff
#

10?

#

Why don't you just weld a hitbox to each shard

#

So it follows

brazen knoll
#

i tried

shy cliff
#

Of course your game lags if it has so many shards

#

And you should make a table

#

That contains all the hitboxes

#

And then pass it into the zone module.new function

brazen knoll
#

alright

shy cliff
#

See this "Spots" variable that i passed in?

brazen knoll
#

i know already

shy cliff
#

I added all my in-game hiding spots into that table

#

Now it counts as 1 zone

brazen knoll
#

oh

shy cliff
#

which causes like 0 lag

brazen knoll
#

ohhhhhhhh

#

alright

#

i am not used to modules

#

now it doesn't workkkkkkkkkkkkkk

#

its doesnt even prints

shy cliff
#

Can you just show me the script

brazen knoll
#

alr

#

@shy cliff

#

i also tried that shard creates one hitbox and the hitbox teleports to shard, it makes less lag

#

of course.. its doesn't destroyes and creates

brazen knoll
shy cliff
eager vesselBOT
#

studio** You are now Level 5! **studio

shy cliff
#

😭

brazen knoll
#

i am not

shy cliff
#

You loop through the hitbox like 1000 times of course it lags 😭

brazen knoll
#

oh, i didnt added to hits "--"

#

but the function

#

i added "--"

shy cliff
#

You loop throught the getpartsinparts

shy cliff
brazen knoll
shy cliff
#

the script is extremely confusing and disorganized though 😭

#

What is the "hite" parameter in the zone module item entered

#

event

brazen knoll
#

touched

brazen knoll
shy cliff
#

it's okay

brazen knoll
#

Also thanks for you patience

shy cliff
#

No problem

#

Still, here you don't loop through all the game hitboxes and handle them all at once

#

I bet that you run the inkShard function like 100 times

#

And that makes like 100 zone checkers

#

so you should make a hitbox, weld it to the shard and then use table.insert to put the part into a table

#

then you add the table as a parameter of zone module.new (you would do this in a separate script or different function)

brazen knoll
#

alright