#2 players hitting at a similar time

1 messages · Page 1 of 1 (latest)

raven heart
#

i have this problem where then stun is apply for some reason 2 players can be affected by stun i hada add parameters in de localscript where the signal is sended and i knwo that if the signal is already sended it is not magicaly going to disappear so i tought that if I apply the same "if not stun then" it would work and well, it did not work.

karmic dove
#

literally have no clue what you just said just explain whats going on right now and what you want it to do i did not understand a word

raven heart
#

imagine that a player sends a signal

#

a punch

#

and it goes to the server

#

and imagine that the punch has delay

#

so it going to take 1 second to land the punch

#

so in the server were the punch lands

#

i want that if a player "plr" has stun it cancells

karmic dove
#

stun? so like a block?

raven heart
#

no here me out

#

if you punch

#

and a has been punched

#

it applies stun

#

and if you have stun you CAN NOT pucnh

karmic dove
#

ohh ok so like if someone is stunned you want it so they cant punch while they are in the stun?

raven heart
#

yes

#

but that is already code it

#

what you have just said works but not at 100%

#

if two players land a punch at a similir time

#

they both take damage instead of only the last one to send the punch

karmic dove
#

have a table this is how i do this stuff it might be a bad way but idk i use a table and i insert whats going on

#

so like if someone is stunned add them to the table and check if they player throwing a punch is in the table then return end the script or just end it idk

raven heart
#

well basically what you have just said is, well i think is the same that i am doing, the difference is that i use attributes instead of tables

karmic dove
#

oh idk tbh man ngl only way would be to just have more checks or idk if there is a delay though between the remote firing it could be that you might be that idk

raven heart
#

This is how i code it, in a local script a send a signal that if an enemy is in a hitbox it send a signal to a server where it applys stun

raven heart
karmic dove
#

you cant have it all on the server? or use a module>

#

?

raven heart
#

wait what, i understand what you say but at the same time i dont

#

OOOOOOOO

#

yeah i understand it

#

but i think the problem is still going to persist

#

because it just like putting the code in another place

karmic dove
#

yeah but module scripts you can grab data directly from it you dont have to sent it through an event so its faster so maybe doing that it will be able to check who was stunned first quicker then the remote event i think the issue is the punch code or what ever runs faster than the server can get the info that a player is stunned

raven heart
#

WAITT

#

i have an idea

#

the hitbox system

#

that i use

#

isa a module script

#

so i can chek it literally

#

thre

#

and just put somehting

#

like iof plr.stun true then return end

#

THANKS ALOOT!!!!

karmic dove
#

oh np sorry im bad at studio im a web developer more than a roblox game developer

raven heart
#

yeah bro no problem