#Attacker wont receive damage

1 messages · Page 1 of 1 (latest)

winter sonnet
#

Works for me

#

What skript version are you on boss

potent light
#

the latest

winter sonnet
potent light
#

yes

#

multiple until it died

winter sonnet
#

Its your variable change it to a local variable

potent light
#

wdym?

winter sonnet
#

Well it's how you set it up

#

Remove the if {d} is not set

#

cause what it's doing is if the victim is at max health 10-10

#

{d} would be 0

potent light
#

ohhh

#

ok ty

rugged topaz
#

this should also be a local variable

potent light
#

what’s that 🙃

void heath
#

it makes it so the variable is only accessible in that code block and gets removed after

#

here, you create the variable and use it only there

#

but it could cause issues with multiple players and whatever

#

so you could have it be {_d}

potent light
#

ohhh

#

I always put those underscores in randomly

void heath
#

bad idea xD

#

you need to use it when it's only ever used in a specific code block and never again after

potent light
#

Wait so

#

{_name} is anywhere in the file or anywhere in the code block?

#

And what does {name_} mean

void heath
void heath
#

say you have a on death: event
a variable named {_idk} in that event would only be accessible for that specific event

#

if someone else dies, they have their own variable

potent light
#

Oh yes I need that

void heath
#

you also cant access that variable inside another event/command/function

#

it's only for that specific code block, for that specific triggered event

potent light
#

So if I did an in damage event with the function {_d} then it would be specific for dif players

void heath
#

wdym by function here

potent light
#

srry i just dk the name of what its called

void heath
#

local variable?

potent light
#
   damage attacker by {_d}

#

yeah that

void heath
#

yeah

potent light
#

local variable

#

im still relatively new

void heath
#

that's better, cus, after the event, the variable will be deleted (since you dont need it no more)

#

plus, if someone else triggers this event at the same time, it won't have to share the variable; local variable will exist separately on both instances of the event

#

in your case, since the code you execute is instant, it shouldnt matter too much... but it's a good thing to learn how to use for when you need it

#

im going to sleep now, gn