Jump to content

Potion effects if within certain radius of a player skript need help


Kitti_Chan

Recommended Posts

So I'm trying to create a skript that'll give a player poison and nausea if they get too close to a player, but turns out what I did was outdated:

 

on join:
	wait 1 tick
	while player is alive:
		if players in radius of 5 of player is true:
			apply nausea 2 to the player for 5 seconds
			apply poison 2 to the player for 5 seconds
		wait 1 second

The error it gives me is  "Numeric ids are not supported anymore" in line 4 only. Anyone know how I can fix this? Thanks! IF THIS IS SUPPOSED TO BE IN A DIFFERENT FORMAT OR LOCATION PLEASE TELL ME, I'M NEW HERE!

Edited by Kitti_Chan
Added the : after the first sentence, and added an only after "line 4."
Link to comment
Share on other sites

I would do a different method. I'm half checking the forums, so let me know if this works.

on join:
	wait 1 tick
	while player is alive:
		loop all players in radius 5 around player
		if loop-player is alive:
			apply poison 2 to loop-player for 5 seconds
			apply nausea 2 to loop-player for 5 seconds

It might not work, but I would work with doing a loop all players. 

Capture.PNG.3810aa656f0ae5a4a06ad625e2b40c5f.PNG

Link to comment
Share on other sites

16 minutes ago, Elektrodes said:

I would do a different method. I'm half checking the forums, so let me know if this works.


on join:
	wait 1 tick
	while player is alive:
		loop all players in radius 5 around player
		if loop-player is alive:
			apply poison 2 to loop-player for 5 seconds
			apply nausea 2 to loop-player for 5 seconds

It might not work, but I would work with doing a loop all players. 

e it says it can't understand the condition/effect at line 4 and it says there's no loop that matches loop-player in line 5 so i tried changing it to loop-all instead and then it said there was no loop-player or loop-all aaaa

Link to comment
Share on other sites

1 hour ago, Kitti_Chan said:

e it says it can't understand the condition/effect at line 4 and it says there's no loop that matches loop-player in line 5 so i tried changing it to loop-all instead and then it said there was no loop-player or loop-all aaaa

Do something like this then. If you have SkUnity it should work!

loop all players:
	if distance between the player and loop-player is smaller than 5:
		[Do stuff to the loop players]

 

Capture.PNG.3810aa656f0ae5a4a06ad625e2b40c5f.PNG

Link to comment
Share on other sites

45 minutes ago, Elektrodes said:

Do something like this then. If you have SkUnity it should work!


loop all players:
	if distance between the player and loop-player is smaller than 5:
		[Do stuff to the loop players]

 

wait nvm im dumb

Edited by Kitti_Chan
Link to comment
Share on other sites

Just now, Elektrodes said:

You're good! I recommend going to Google and searching stuff like "loop players in radius skript" and other keywords. Examples will pop up. Hope I helped!

is skunity a plugin, or the forums? bc if it's a plugin I don't see it ;w; without it, it still says it can't understand "loop all players"

Link to comment
Share on other sites

1 hour ago, Kitti_Chan said:

is skunity a plugin, or the forums? bc if it's a plugin I don't see it ;w; without it, it still says it can't understand "loop all players"

 

Edited by Elektrodes
Misinformation, mentioned Skript wrong.

Capture.PNG.3810aa656f0ae5a4a06ad625e2b40c5f.PNG

Link to comment
Share on other sites

SkUnity is actually a forums. The expression "loop all players" is built right into Skript.

Santio71 -> Developer

Development Lead for Minehut Events Team


First Joined: Jan. 24, 2016

[VIP]~2019

Joined CET: July 22, 2019 (About 1.75 years ago) 

[PRO]: May 6, 2020

Rejoined CET: June 15, 2020

Moderator: December 19, 2022

himods_1_464x213.pngok3.png.9f407538426375980dbfd1a70bd93a74.pngok2.png.2d1e6960fee974293bc3aaebeb41d5db.png

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
×
×
  • Create New...