#Freaky detection

1 messages · Page 1 of 1 (latest)

bleak merlin
#

Ok not so long ago (2 hours) i was asking on how to detect anchored parts touching a part (which i got with workspace:GetPartsInPart) but now for some reason the for loop im using does some freaky stuff (more info in comment)

#

ok so this explosion module makes an explosion

#

when a player/character touches this explosion it does a buncha stuff

#

but for whatever reason, it seems to be applying these effects back to back to back

#

like a character gets hit, gets knocked back and ragdolled, gets back up, and instantly gets hit again despite far from being close to the explosion (in fact the explosion is gone by then)

#

i suspect it does this for every part it hits so i added hit = nil as a test but it did absolutely nothing

dawn shadow
#

what's the thing the player is touching? send a screenshot

#

@bleak merlin

bleak merlin
#

explosion

#

circle thingy that the script makes

#

i'll take another ss of that part

dawn shadow
#

did you just make a custom explosion because you didn't like the one roblox had?

bleak merlin
#

yeah lmao

#

also its cool and i didnt know how to change the default roblox explosion's icon

#

here is the output

#

a means every time it hits

#

the first hit prints a buncha stuff aka every part it hits

#

but after that it does this weird thing (each of these a's have a delay between them, that being i frames.)

dawn shadow
#

Just make a part for a hitbox around the explosion so you only have to check the parts once

uneven flicker
bleak merlin
#

im never organising my code

bleak merlin
dawn shadow
bleak merlin
#

that isnt the main concern tho

dawn shadow
#

your being hit back cuz of your shitty looping

dawn shadow
#

if you only once, use a hit box

#

and if you do it at it's peak

bleak merlin
#

ok im gonna try only checking once

dawn shadow
#

you could be hit by it and it won't do anything until it's at it's peak

bleak merlin
#

still does it

#

i made it so that it only checks after the boom hit its biggest

#

and right before it gets destroyed

dawn shadow
#

bro im done @plain vector @uneven flicker your turn

bleak merlin
#

💀

#

i also have a hitboxes script which uses the same thing but only checks once so its not because of "my shitty loopings"

dawn shadow
#

you didn't even have to use a for loop in the first place bro

bleak merlin
#

for?

dawn shadow
#

I was gonna ping the neurodivergent one named moontune but couldn't find the name in pings

uneven flicker
#

would need to see the whole function ;o

#

that and i don't really get what the issue is?

bleak merlin
#

audio abit crunched up 🥲

uneven flicker
bleak merlin
#

how do i put it in lua format again

uneven flicker
bleak merlin
#

uhh

uneven flicker
#

i can barely read that but the task.wait explains the delay for a start

#

plz put it in text

#

i aint reading that blurry ahh

bleak merlin
#

it exceeded the word limit

uneven flicker
#

so make it a txt file

#

it auto prompts you to do that 🙄

bleak merlin
#
        boom.Size = (Size/5)*i  
        boom.Transparency += 0.1
        local Params = OverlapParams.new()
        coroutine.wrap(function()
            for _, hit in pairs(game.Workspace:GetPartsInPart(boom,Params)) do
                print(hit)
                if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
                    local iframes = hit.Parent.iframes
                    if iframes.Value == false then
                        print("a")
                        iframes.Value = true
                        if hit.Parent:FindFirstChild("HumanoidRootPart").Anchored == true then
                            hit.Parent:FindFirstChild("HumanoidRootPart").Anchored = false
                        end
                        hit.Parent:FindFirstChild("Humanoid"):TakeDamage(dmg)
                        if killer ~= nil and game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) then
                            if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).UserId == killer.UserId then

                            else
                                hit.Parent.Killer.Value = killer.UserId
                            end
                        end

                        table.insert(db,hit.Parent)
                        kb.Start(hit.Parent, (hit.Parent.HumanoidRootPart.Position - boom.Position).Unit * Vector3.new(Pressure.X, Pressure.Y, Pressure.Z))
                        if ragdolldur then
                            ragdoll.Start(hit.Parent)
                            task.wait(ragdolldur)
                            ragdoll.Stop(hit.Parent)
                            iframes.Value = false
                        end
                        table.remove(db,table.find(db, hit.Parent))
                    end
                    hit = nil
                end
            end
        end)()
        task.wait(0.02)
    end
boom:Destroy()
#

thats the for loop for the explosion

uneven flicker
#

bruh

bleak merlin
#

the rest of the function is basically making the explosion bigger

oh wait the rest is the function making the explosion

uneven flicker
#

whole function

bleak merlin
#
    local boom = Instance.new("Part")
    boom.Shape = Enum.PartType.Ball
    boom.Position = Pos
    boom.Color = Color
    boom.Parent = game.Workspace
    boom.Anchored = true
    boom.CanCollide = false```
#

thats the stuf fbefore it

uneven flicker
#

please just paste the whole function at once

#

if its too long it'll prompt you upload as text, just do that

bleak merlin
#

i tried and i just got "your message could not be delivered"

#

no prompting for some text file or whatever

uneven flicker
#

what value are you giving to ragdolldur?

bleak merlin
#

for the video its 2

uneven flicker
#

what is the size

bleak merlin
#

15 radius

uneven flicker
uneven flicker
# bleak merlin 15 radius

the hitting multiple times is coming from for _, hit in pairs(game.Workspace:GetPartsInPart(boom,Params)) do picking up more than 1 of the character's parts

#

paired with the 2 second delay between each hit, that's where the results seen in your video are coming from.

bleak merlin
#

ah

naive oreBOT
#

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

uneven flicker
#

and based on the context this looks like where the force is coming from kb.Start(hit.Parent, (hit.Parent.HumanoidRootPart.Position - boom.Position).Unit * Vector3.new(Pressure.X, Pressure.Y, Pressure.Z))

#

though im not sure what kb is

bleak merlin
#

module script

#

handles knockback

uneven flicker
#

yea thought so

#

the Pressure is a giveaway for context

bleak merlin
#

not quite sure how to make it so that it only hits the player once but can also hit everyone in it

uneven flicker
bleak merlin
#

wouldnt want it to only do it for hrp

uneven flicker
#

lol nah idc but it does do literally nothing, get rid of it.

bleak merlin
#

was afraid of abit of delay but ok

dawn shadow
bleak merlin
#

perforate didnt come

dawn shadow
#

I just got too many things to deal with and this was not top priority

uneven flicker
dawn shadow
dawn shadow
#

nice ig

#

well gl @bleak merlin

bleak merlin
#

thx 👍

dawn shadow
#

not the salute

#

wild

#

now I get to rest a whole 2 minutes before I have to tell someone to go to #💵︱hiring