Attacking Hitboxes | Roblox Essentials #2

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 58

  • @lui2330
    @lui2330 9 місяців тому +9

    for a more advanced hitbox, i suggest when the input is detected send it to server, then on server play the animation with a marker, and use invoke to get the hitbox from client, checking if it is valid, then doing a sanity check with magnitude, regardless this is great for someone just learning, a follow up video on a more advanced hitbox would be sick

    • @SolepsusYT
      @SolepsusYT  9 місяців тому +4

      i dont understand why the hitbox has to be instantiated from the client. It doesnt make a lot of sense to have the sanity check either, if the only way to "cheat" the hitbox is by teleporting the player to the enemy, you would be making useless calculations by grabbing the magnitude (as teleporting the plr with hacks would result in the cottect magnitude anyway)

    • @lui2330
      @lui2330 8 місяців тому

      @@SolepsusYT client hitboxes detect quicker than server hitboxes, responsiveness from clients are way better than server

    • @Musab_YB
      @Musab_YB 8 місяців тому

      ​@@SolepsusYT Assuming your hitbox is server-sided as it should always be
      You should NEVER play animations on server

    • @SolepsusYT
      @SolepsusYT  8 місяців тому

      well i dont know about NEVER. But it does reduce lag, albeit not that much.@@Musab_YB

  • @TopicalHat
    @TopicalHat 9 місяців тому +4

    You can use a combination of a hitbox and a raycast to detect for walls and whatnot by the way

  • @verdox0
    @verdox0 9 місяців тому +36

    one thing that i will mention is that using touch event will make it so its super easy for hackers to control how big the hitbox is and they can hit anyone on the map if they wanted to, so to prevent that you can add a check that checks how far away the attacker is from the victim and based on that the server has to decide on if the attack should be allowed or not, so the max distance that the server allows the attack to be from has to be decided by you based on how far away the attack usually goes. you should also make the distance a bit longer than expected so that laggy players can still hit people, but the down side of doing that is that hackers can now hit players from further away so you really need to balance the max attack distance value

    • @SolepsusYT
      @SolepsusYT  9 місяців тому +6

      it should be mostly fine since the hitbox is created in the server, but this could be bypassed by teleporting the player to the enemy but at that point its a whole nother' issue

    • @kaiser9199
      @kaiser9199 9 місяців тому

      @@SolepsusYTvery true
      if anyone is interested i'd recommend watching suphi kaner's video on anti-cheat, he's one of the best roblox tutorial channels there is
      he talks about checking position with respect to character speed and doing an action based on the outcome, this battles instant teleportation to an object

    • @galicate
      @galicate 9 місяців тому +1

      The Touched Event is really unreliable too, shouldnt be used for anything honestly.

    • @verdox0
      @verdox0 9 місяців тому

      ​@@SolepsusYT if the part is a parent of the player(hacker) then the touch event works based on how the player detects it as in it wont matter if its a server script because the detection is client sided either way. so touch event should never be fully trusted. an example of this is that classic swords have a server script and it uses a touch event but any time you join a game like sword fights on the heights there are hackers who make their sword hitbox size 1024(the biggest part size) and then they kill everyone on the map

    • @verdox0
      @verdox0 9 місяців тому

      @@galicate maybe he could use FindPartsInRegion3 but im not sure if this is the best solution in this case. doing many raycasts in the shape of a the leg or arm could also work. i made a sword on roblox by raycasting the "shape" of the sword every 0.2 seconds on the client side when someone attacks with a sword and if one of the raycasts hits, then its sent to the server and the server checks the distance of the players to make sure the attack is allowed

  • @glegolas5008
    @glegolas5008 6 місяців тому +2

    I know this is old but I recommend calculating what targets are hit by the hitbox on the client because its more responsive and it puts less of a load on the performance of the server. From there, you can just run sanity checks on the server to make sure the target is actually in a reasonable position to hit the target through magnitudes and dot products.

    • @SolepsusYT
      @SolepsusYT  6 місяців тому +2

      thats true but the point of the video was to show the mechanism behind hitboxes and method of use. It's better to have client side hitboxes but then I would have to cover sanity checks / anti cheat and i didnt wanna go in that direction yet, would be too long to cover in the vid

    • @glegolas5008
      @glegolas5008 6 місяців тому +2

      @@SolepsusYT ye i see where you are coming from!

  • @iilogll
    @iilogll 9 місяців тому +3

    great tutorial for beginners but for any beginners that want to make it more advanced and less exploitable try using shapecasts instead

    • @NovaWolf_
      @NovaWolf_ 9 місяців тому

      Currently shapecasting is pretty new and is not recomended for hitboxes due to how collison detection works, if you wanna make a good hitbox use raycasting and attachment points.

  • @ThatOneScreamingBirdLololol
    @ThatOneScreamingBirdLololol 2 дні тому +1

    Me
    Not a dev
    Watching this
    Useful knowledge 👍

  • @qwqpal9690
    @qwqpal9690 4 місяці тому +1

    This is a pretty good tutorial and I want to achieve something like what this video has shown. I did the script right with no mistakes but the part isn't spawning do you mind explaining it to me?

  • @NotChron
    @NotChron 9 місяців тому +4

    that thumbnail is giving me byteblox flashbacks.,.,.,... if you end up making a community please care for it.,,.,.,....... regardless good video!

    • @byteblox100
      @byteblox100 9 місяців тому +7

      Lmao

    • @Elite_CMDO
      @Elite_CMDO 8 місяців тому

      @@byteblox100 yooooooooooooooooooo

  • @Rb2b-but-new
    @Rb2b-but-new 3 місяці тому

    it's like Smash 64's hitboxes

  • @Hakqxw
    @Hakqxw 4 місяці тому +1

    underrated

  • @FlyinC4T
    @FlyinC4T 7 місяців тому +1

    I now know how to weld a part to a player...
    by basically welding the part to a player, man I'm stupid 😭

  • @--Neptune-
    @--Neptune- 9 місяців тому +2

    I really fw ur work style bless bro im subbing

  • @graff6909
    @graff6909 4 місяці тому +1

    Bro are you making a Muay Thai Game?

  • @qwqpal9690
    @qwqpal9690 4 місяці тому +1

    why isn't my hitbox spawning?

  • @--Neptune-
    @--Neptune- 9 місяців тому +1

    also when u move objects using the move arrows, you have the position for that axis displaying, how can i do that? thanks

    • @SolepsusYT
      @SolepsusYT  9 місяців тому

      do you mean the cube thing at the top right?

  • @sunzalea3257
    @sunzalea3257 3 місяці тому

    Is it good performance wise to make the weld on the server and deal damage within the same script?

  • @ExoticFoxy
    @ExoticFoxy 9 місяців тому +1

    babe byteblox dropped

  • @TrentDalton20093
    @TrentDalton20093 2 місяці тому +1

    Where did bro just get a hitbox at in the beginning

    • @SolepsusYT
      @SolepsusYT  2 місяці тому

      that was just a regular part made slightly transparent, red, and not collidable

  • @arer2025
    @arer2025 2 місяці тому +1

    how to make cooldown for that script?

    • @ryletik4565
      @ryletik4565 2 місяці тому

      Check guides on debounce's

  • @kinqoh
    @kinqoh 9 місяців тому

    dawg thanks for this, how long have you been scripting for?

    • @SolepsusYT
      @SolepsusYT  9 місяців тому

      a little over 3 years!

  • @AntusrioCreoli
    @AntusrioCreoli 6 місяців тому

    Bro, may i get that model? I like that bro.

  • @AntusrioCreoli
    @AntusrioCreoli 6 місяців тому +1

    May i hire you as scripter bro? I'll give you an reward.

    • @SolepsusYT
      @SolepsusYT  6 місяців тому +1

      Depends on what work

  • @spgetty959
    @spgetty959 4 місяці тому

    could plis put the code in the decscripion or on a comment

  • @shubaponcr341
    @shubaponcr341 8 місяців тому

    0:51

  • @leki_beerri
    @leki_beerri 9 місяців тому

    nice

  • @mithunns128
    @mithunns128 9 місяців тому

    can u send me the code pls