Jump to content

world Border


AgentGamerPro

Recommended Posts

i'm making a gamemode where the world border moves with the pig. Yeah, that's it.
Here is the skript:
 

function spawnmob(loc: location, entity: entity type):
	spawn {_entity} at {_loc}

on death:
	if victim is pig:
		if victim's name is "World Border":
			cancel event

command /pig:
	trigger:
		spawnmob(location of player, pig)	
		set name of last spawned entity to "World Border"
		set {_entity} to last spawned entity

every 0.1 seconds in world "world":
	set {_x} to x-position of {_entity}
	set {_z} to z-position of {_entity}
	make console execute command "worldborder center {_x} {_z}"

I don't get any errors at all, but the border does not move at all. I know this because i set the border to 50 or smth

Edited by Agentgamer100YT

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

1 hour ago, MagicMan49 said:

I think I know why it is not working. You forgot to put percent signs around the variables in the command.

Here is what it should look like:


make console execute command "worldborder center %{x}% %{z}%"

 

I've tried this already, but it still dosen't work.

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

It is not working because the variables have different names, you need to keep your names consistent.

Try this:

every 0.1 seconds in world "world":
	set {_x} to x-position of {_entity}
	set {_z} to z-position of {_entity}
	make console execute command "worldborder center {_x} {_z}"

 

Link to comment
Share on other sites

  • 5 months later...
  • 7 months later...

Hi Fiskmannen33!

I will now be locking this post since there aren't much discussions going on in this thread anymore.

Next time you find a post under the wrong category or someone purposely necroposting, you may report the post/reply instead.

🔒Post locked.

Thanks!
 

On 11/19/2021 at 11:35 PM, Fiskmannen33 said:

Lock this thread.

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...