#ModuleScript executed 14 being called only once.
1 messages · Page 1 of 1 (latest)
Well where do you actually call the CreateExplosion function?
here
and the event is fired on a localscript in StarterCharacterScripts
i'm sending it
wait
kokusen hitbox is executed a lot of times too
and kokusenhitboxevent is the same
So Touched fires for each piece of the player, so that will fire many times. hit will never be a model, as Models cannot touch, it'll only be parts within the model
oh
** You are now Level 2! **
Yep
Keep track of what players you've touched to make sure you're not touching the same player twice.
You'd probably have to check to see when the player has stopped touching too, so they can activate the event again, so probably TouchEnded until none of that player's parts are touching anymore
Yes you can. If you want to keep the typing, you'd do hit: BasePart but you can do hit
oh ok
so i make the same player cant "touch" twice until the touched event ends
Well there's a more simple solution of just adding a cooldown, called a debounce, where you set some variable to false when the event occurs (you'd have to make that per-player though) and if it's false for that player, don't run the code, something like this: https://devforum.roblox.com/t/hitboxtouched-keeps-repeating/2021358/7
More complex would be to keep track of what parts of that player are touching, and only reset the value when every one of that player's parts stop touching
As the other two said, you should just use a debounce. If you want each player to have their own debounce create a table and store their id in there and remove it when you want them to be able to touch it again. It’s something like this: local debounce = false Obj.Touched:Connect(function() if (debounce) then return end debounce = t...
any idea of how can i make debounce exclusive for one player?
tables.
local debounces = {}
if (debounces[player]) then return end
debounces[player] = true
task.wait(1)
debounces[player] = nil
You have to move the debounce variable outside of the connect function
ok
otherwise it'll always start as false, thus always allowing it
now the part isn't created at the time of the touch, but 1 second later something like that
the player thing i'm doing later
you should only set the debounce to true after a successful creation, so inside the if
did it
but the delay still appears
oh
its because of hit service
basically in hitservice there's a wait to until the knockback is false
and the explosion was being affected by it
so when i moved the explosion to before it the module worked
now i'm making the player thing
@urban abyss well it stills hits only 1 player
also, for some reason i cant change its rate
i made a parameter for it
look
function module:CreateExplosion(plr, anchored, rate)
VFX.Rate = rate
and in kokusenhitbox i put it as 1
just for testing
make it hit only the humanoidrootpart
i read some of your code and i think it only hits one person cuz you made a debounce check up there
but i think if i did it then if it touched only the rightarm the script would not execute?
well for most games it doesnt change anything in the game's playability cuz the humanoidrootpart is too close to all the other parts
you can create a hitboxmodule that makes all the checks and separates the players that you hit in models and not parts
if hit.Parent.Name ~= plr.Name and hit.Parent:FindFirstChild("Humanoid") and hit ~= nil and hit.Name = "HumanoidRootPart" then
** You are now Level 3! **
yea and also dont make hit.Parent.Name ~= plr.Name, cuz maybe there is another player with your name
and the ==
you can make hit.Parent ~= plr.Character
yeah
also if you have another parts inside the player parts like accesories if could bug your code
nothing was changed at all but when doing this i dont need to do the debounce thing anymore?
so i can delete it
well i kinda did not understand why you made a debounce in the first place
most attacks hits multiple ppl
its because the vfx
was being created multiple times
because it was hitting right arm, left arm and multiple things so the event was being fired multiple times
and then vfx sttacked
and it was weird
ah that makes sense
well for some reason only 1 npc was ragdolled and knockbacked
also
i'm being ragdolled
did you write that?
oh wait
name
sorry
.Name
well dont ask me why but it stills hits only 1 character
and i made the hitbox larger so it is probably not bc it only touches one hrp
try to debug it printing the parts that were hit
ok
only 1 time clicking g (the trigger key)
and it touched both characters
dummy 1 and dummy 2
3 humanoidrootparts for some reason, the third one isnt my character cuz when i click g with no target it only prints that the event was fired
try to use workspace:GetBoundsInBox() instead of hitbox.Touched
maybe its hitting the same character 2 times
maybe
thats why debounces are useful tho
never seen this command how can i use it
its quite easy
it makes a imaginary box in the workspace with the size and cframe you give it
and returns all the parts inside or touching that imaginary box
also its a workspace method
so i set the CFRAME as the same as the hitbox one right
and you can give it a OverlapParams object
yes
and dont forget the size
i'm making a variable for it
local overlapparams = OverlapParams.new()
overlapparams.FilterType = Enum.RaycastFilterType.Exclude
overlapparams.FilterDescendantsInstances = {character}
then you can make something like this
and it will ignore your character
well whats RaycastFilterType?
just to knnow
know
@pale vector also
i think it isnt possible
to have
any other player
with the same username
only the displayname
also for some reason i cant change the particleemitter's rate
just for preventing yknow
maybe its your graphics
its just an Enum
it basically tells the method you it should treat the FilterDescendantsInstances
no cuz when i set it to 1 on vfx properties it changes but when i change the rate parameter it doesnt
the KokusenVFX its a particle emitter?
yeah
try printing rate
** You are now Level 4! **
i want to make it 0 for a "smooth deleting"
wait are you trying to disable the vfx
you can just use emit....
can you sent a video?
yeah
what
.mkv
lol
i made a copy of the game with the GetBoundsInBox so if i want to work with different commands
i'm testing it on the experience itself
yeah it is bugged there too
i think the vfx is not dissapearing cuz of your two checks up there
the thing is
when i change it
on the vfx properties
it works perfectly
like if i change the emission rate on vfx
it changes
try to set the rate before parenting the vfx to the part
it that dont works i dont know what is happening really
@pale vector two of them are created
and its only on the first time
see
i think that
when i change the rate
vfx is duplicated
so thats why it changes
probably the same reason for kokusen explosion is duplicated
when you change a Clone() property, it creates another clone with these properties
wait its making two vfxs at the same time or you used it 2 times?
did you hit 2 characters?
no
wait
i think i did
yeah i did
but when i hit only one, two vfx are created
@pale vector
the particle is also cloned?
the code does not know which one to change
the other one has 10
the same that isnt enabled
is 1 rate
and the same that IS enabled is rate 10
but in replicated storage, there is only one vfx
why is vfx being duplicated

send your code
** You are now Level 5! **
but vfx is still duplicated
the script that calls this function calls it two times?
maybe its something with the debounces idk
no double executon of the function
i see
@pale vector
its because
theres 2 copies
the one that comes
with part
and the one that i clone
because when you clone a part all its children come too
yeah
i've got it
did you fix it?
yeah
SO
new problem
i will try to resolve it manually
so
when i hit multiple players (two on this example), the first one is ragdolled and knockbacked, and when he gets up, the other player is ragdolled
but i want to make both players be ragdolled at once, but without multiplying the vfx
wdym?
i think this is because of debounces
so i should only apply debounces in vfx
@pale vector also
hitservice is only executed after kokusen explosion
and kokusen explosion has a task wait on its end
so it is executed in like 1 second
you cant put a function inside task.wait
also i'm getting lunch so i may be afk sometime
oh
ok
@pale vector
yeah i did this to resolve the problem
but it didnt work
sorry i meant task.wait
coolguy
@pale vector so
hitservice and kokusenexplosion both have a wait inside of their functions
what?
lemme show
kokusenexplosion
when i execute it
it will wait this time
before the rest of the script is executed
so if i execute kokusenexplosion before hitservice, then hitservice will be executed only after kokusenexplosion waited duration + .5
and inside hitservice
we have this
that works on the same way
@pale vector
so you're running both of them at the same time?
I want to do this
i think i cant use spawn() with modules
you can wdym
also why did you put a bool value inside a wait()