#Damage dealt 8 times instead of 1
1 messages · Page 1 of 1 (latest)
it prints out
no ai could help me, all tried with some debouncing, which didnt worked
think out of the box, print(alreadyHit) on top of this and print(dmg) below this
or instead you can use explosion.Hit:Once() instead of explosion.Hit:Connect()
theres already a post similar to this thats solved
I might have done something wrong, but its not working after I think I did what you told me
now it prints out 4 times
which means player is taking 160 dmg instead of 40
if this hasnt already been resolved, could it be that the thing that makes the explosion is running multiple times? try adding a print before explosion is created
** You are now Level 10! **
oh, youre right
also please do NOT use once for this
if it hits something that isn't player it will not work
just use connect and optionally disconnect it once it hits something
noted, my third day of studio, so I dont know much
** You are now Level 1! **
Once only runs once so if 1 plr gets hit no other ones will get
thanks. one more question is it okay, that I am using
create:FireAllClients(plr, mousepos)
which creates projectile for every client
and then on the server side it creates an explosion(because when explosion was for every client players were turning invisible and their bodies were levitating in the air)?
I hope yall understand what I mean
now I am trying to figure out, why this
projectile.Touched:Connect(function(part)
if part.Parent ~= char and part.CanCollide == true then
game.ReplicatedStorage.Remote.Wybuch:FireServer(projectile.Position)
projectile:Destroy()
connection:Disconnect()
end
end)
is happening 4 or 8 times
because this function is telling server to create an explosion
nahh, I cant with this
why "Z" is being printed two times when I press Z, X, C or F(instead of one time)
and also this
@timber crown what im guessing is you’re cloning the explosion script multiple times
yeah, I know
Ur code is valid, there’s nothing wrong here
because of this
So the only possible problem is cloning
Hmm
so when you click a key, it prints twice
yeah
** You are now Level 2! **
for me it only prints once. i only have 1 input began connection setup
if i add two of them though, it prints twice
so see if you're creating any extra input began connections anywhere
thats why im so frustrated
I dont have anywhere else UIS
and also
we can see where on what line is prints or smth
mhm yup
yeah...
LocalBomb
check to see if maybe there's an extra bomb somewhere that's being created that you don't know about
an extra tool that's being ran
I tripled check everything
I have like 8 scripts max
and remembered
that I was using script to constantly spawn a new bomb
haha
well there's ur problem
the body of spawnNewBomb was being called, causing an extra bomb to be spawned
it still was dealing dmg 4 times
or sometimes after some changes or before some changes it was 8
Shi just make your life easy
but the "first" bomb is just like a template in replicated storage
yeah, except you are inintentionally cloning the template and using it, as you said