Jump to content
  • 0

Can anyone help me with this skript?


DerpyJack21
 Share

Question

I need a skript that detects if a specific player is in water or a waterlogged block, and if they are, it damages them. 

I have a skript that will detect if a player is in water when they move, and if they are, it damages them. This is my current skript:

on any move:
 if name of player is not "JackWill6672":
  stop
 else:
  block at player is seagrass
  damage player by 5

on any move:
 if name of player is not "JackWill6672":
  stop
 else:
  block at player is water
  damage player by 5

on any move:
 if name of player is not "JackWill6672":
  stop
 else:
  block at player is tall seagrass
  damage player by 5

I want to make it always be checking, even when the player does not move, and I also want to have it detect if a player is in a waterlogged block. Thanks in advance!

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

The Skript addon MiSK should help you quite alot here with the following syntax:

https://skripthub.net/docs/?id=3691

And I'm unsure what you exactly want because at the start you said "when they move" and at the end "when they don't move".

Edited by Starshinex3

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

  • 0
2 minutes ago, Starshinex3 said:

The Skript addon MiSK should help you quite alot here with the following syntax:

https://skripthub.net/docs/?id=3691

And I'm unsure what you exactly want because at the start you said "when they move" and at the end "when they don't move".

I will check out the MiSK addon, and also, I should probably go into a bit more detail of explaining

I have a skript currently that will detect when a player moves, and if they move, it will check if they are in water, seagrass, or tall seagrass

What I want is a skript that will always detect if they are in either water, or a waterlogged block. I want it to detect that even when they don't move

Link to comment
Share on other sites

  • 0
4 minutes ago, Starshinex3 said:

The Skript addon MiSK should help you quite alot here with the following syntax:

https://skripthub.net/docs/?id=3691

And I'm unsure what you exactly want because at the start you said "when they move" and at the end "when they don't move".

I just checked https://skripthub.net/docs/?id=3691, and yeah that would be perfect!

Link to comment
Share on other sites

  • 0
3 minutes ago, DerpyJack21 said:

I will check out the MiSK addon, and also, I should probably go into a bit more detail of explaining

I have a skript currently that will detect when a player moves, and if they move, it will check if they are in water, seagrass, or tall seagrass

What I want is a skript that will always detect if they are in either water, or a waterlogged block. I want it to detect that even when they don't move

Maybe do a loop that just checks every 1 second and use the misk syntax to check if the loop-player is in water that should do it.

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

  • 0
6 minutes ago, Starshinex3 said:

Maybe do a loop that just checks every 1 second and use the misk syntax to check if the loop-player is in water that should do it.

Do you think you could create a skript with the loop and the misk syntax? I am not very fluent in skript and I want to have it be good, sorry if it's too much work for you

Link to comment
Share on other sites

  • 0

Uhm I can give it a try:

Type 1:

on join:
 while player is online:
  player is in water:
   damage player by 5
  wait 1 second

Type 2:

every 1 second:
 loop all players:
  loop-player is in water:
   damage loop-player by 5

These should work don't ask me which ones saves performance tho.

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

  • 0
7 minutes ago, Starshinex3 said:

Uhm I can give it a try:

Type 1:


on join:
 while player is online:
  player is in water:
   damage player by 5
  wait 1 second

Type 2:


every 1 second:
 loop all players:
  loop-player is in water:
   damage loop-player by 5

These should work don't ask me which ones saves performance tho.

I tried both of them, Type 1 did not damage the player, and Type 2 had an error saying it could not understand event "every 1 second"

Link to comment
Share on other sites

  • 0
25 minutes ago, DerpyJack21 said:

I tried both of them, Type 1 did not damage the player, and Type 2 had an error saying it could not understand event "every 1 second"

Huh that's really weird because the "every 1 second" should be a really basic skript thing and should work without any issues keep in mind that I coded mine with 1 space instead of the usual 1 tab or 4 spaces so please adjust it to the already existing code in your file.

MiSK also recommended protocollib to be installed don't think that should affect the second error but hey skript can be rather weird sometimes.

Edited by Starshinex3

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

  • 0
18 minutes ago, Starshinex3 said:

Huh that's really weird because the "every 1 second" should be a really basic skript think and should work without any issues keep in mind that I coded mine with 1 space instead of the usual 1 tab or 4 spaces so please adjust it to the already existing code in your file.

MiSK also recommended protocollib to be installed don't think that should affect the second error but hey skript can be rather weird sometimes.

Okay so when your second skript had errors it was because I had added a bit more skript so sorry about that. But the second skript also does not damage the player

Link to comment
Share on other sites

  • 0

Sorry kinda at a loss here with no error message popping up my guess is MiSK is just not working but don't really know how to solve it.

on join:
 while player is online:
  block at player is water:
   damage player by 5
  if block data tag "waterlogged" of block at player is true:
   damage player by 5
 wait 1 second

That could work but I don't really have a way of testing it rn it requires SkBee tho.

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share



×
×
  • Create New...