Solved damage cause not working

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Mar 18, 2021
16
0
1
25
im trying to make a person imune to explosions

Code:
on damage:
    if damage cause is explosion:
        victim is a player:
            cancel event
 
yea, i have alot of issues with damage cause, luckily you can just do this
Code:
on damage:
    if "%damage cause%" is "explosion":
        victim is a player:
            cancel event
 
PatoFrango is right, (since they won't give the code straight up) it should be:

Code:
on damage:
    if "%damage cause%" is "entity explosion":
        victim is a player:
            cancel event
Not quite right. What I meant was:
Code:
if damage cause is block explosion:
 
Not quite right. What I meant was:
Code:
if damage cause is block explosion:

No, I was right. What does Block Explosion check for? I tested Entity explosion with creepers, ghasts and tnt, and it returned true. Block explosion returned absolutely nothing.
 
No, I was right. What does Block Explosion check for? I tested Entity explosion with creepers, ghasts and tnt, and it returned true. Block explosion returned absolutely nothing.
Im not talking about which type you end up using. I dont know if it’s “block” or “entity” explosion, the problem with your answer was you stringified the values unnecessarily (by doing “%damage cause%” and “insert correct explosion type here” instead of removing the quotes and percent signs)
 
Im not talking about which type you end up using. I dont know if it’s “block” or “entity” explosion, the problem with your answer was you stringified the values unnecessarily (by doing “%damage cause%” and “insert correct explosion type here” instead of removing the quotes and percent signs)
Oh, okay. I have a bad habit of doing that because of some skripts I've worked on giving errors when using "is" as a check instead of "="
 
Oh, okay. I have a bad habit of doing that because of some skripts I've worked on giving errors when using "is" as a check instead of "="
Hmm that’s weird, it’s more common and more true to the true purpose of Skript to use English words rather than symbols
 
Hmm that’s weird, it’s more common and more true to the true purpose of Skript to use English words rather than symbols
Well I code in Java and Lua and multiple other programming languages. When I use a programming language of any type, I tend to stick to my roots.
 
Status
Not open for further replies.