Jump to content

Function in a Function


AgentGamerPro

Recommended Posts

		format slot 11 of player with diamond sword named "&b&lMelee Weapons" to close then run [MeleeShop(player)]

function MeleeShop(p: player):
	set {_u} to uuid of {_p}
	wait 3 ticks
	open chest with 3 rows named "&a&lShop" to {_p}
	loop 10 times:
		if {_i} is not set:
			set {_i} to 0
		else:
			add 1 to {_i}
		format slot {_i} of {_p} with gray stained glass pane named "&a" to be unstealable
	loop 10 times:
		if {_i} is 9:
			set {_i} to 17
		else:
			add 1 to {_i}
		format slot {_i} of {_p} with gray stained glass pane named "&a" to be unstealable
	format slot 10 of {_p} with iron sword named "&fSteel Sword" with lore "&7Made loosely with tin an iron.", "&7Maybe not the best choice." and "&6Price &e&l| &r&6100 Coins" to run [SteelSword({_p})]

function SteelSword(p: player):
	if {Coins::%{_p}%} is greater than or equal to 100:
		give {_p} iron sword named "<##e4e4e4>Steel Sword" with lore "<##d5d5d5>Made loosely with tin and iron." and "<##d5d5d5>Maybe not the best choice."
		remove 100 from {Coins::%{_p}%}
		send "&aSuccess!" to {_p}
	else:
		send "&cNot enough coins!" to {_p}

the SteelSword function wont work? why? i get no errors.

  • Like 1

 

 

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

Don't know. Those GUI's are really buggy sometimes. Use this version instead:

Works, and I tried it.

 

function MeleeShop(p: player):
	set {_u} to uuid of {_p}
	wait 3 ticks
	create new gui with virtual chest named "Melee Shop" with 3 rows:
		format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, and 28 with gray stained glass pane named "&a"
		format gui slot 10 with iron sword named "&fSteel Sword" with lore "&7Made loosely with tin an iron." and "&7Maybe not the best choice." and "&6Price &e&l| &r&6100 Coins":
			SteelSword({_p})
	open last gui to {_p}
function SteelSword(p: player):
	if {Coins::%{_p}%} is greater than or equal to 100:
		give {_p} iron sword named "<##e4e4e4>Steel Sword" with lore "<##d5d5d5>Made loosely with tin and iron." and "<##d5d5d5>Maybe not the best choice."
		remove 100 from {Coins::%{_p}%}
		send "&aSuccess!" to {_p}
	else:
		send "&cNot enough coins!" to {_p}

 

Edited by rosathorn
  • Thanks 1

rose city STICKER

RosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaR

i code, animate, develop, UI design, learn, and adapt, as well as make servers, of course

💐Joined Minehut sometime in 2014
💐VIP sometime in 2018
💐Legend in January 2021
💐Helper on 4/11/2021
💐♥ (Retired) on 5/17/2021
💐 Moderator on 8/18/2023

Link to comment
Share on other sites

16 hours ago, rosathorn said:

Don't know. Those GUI's are really buggy sometimes. Use this version instead:

Works, and I tried it.

 



function MeleeShop(p: player):
	set {_u} to uuid of {_p}
	wait 3 ticks
	create new gui with virtual chest named "Melee Shop" with 3 rows:
		format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, and 28 with gray stained glass pane named "&a"
		format gui slot 10 with iron sword named "&fSteel Sword" with lore "&7Made loosely with tin an iron." and "&7Maybe not the best choice." and "&6Price &e&l| &r&6100 Coins":
			SteelSword({_p})
	open last gui to {_p}
function SteelSword(p: player):
	if {Coins::%{_p}%} is greater than or equal to 100:
		give {_p} iron sword named "<##e4e4e4>Steel Sword" with lore "<##d5d5d5>Made loosely with tin and iron." and "<##d5d5d5>Maybe not the best choice."
		remove 100 from {Coins::%{_p}%}
		send "&aSuccess!" to {_p}
	else:
		send "&cNot enough coins!" to {_p}

 

Do i need any addons? I get 2 errors:

cant understand this condition/effect: "open last gui to {_p}"

cant understand this condition "create new gui with virtual chest named "Melee Shop" with 3 rows:"

Edited by AgentGamerPro

 

 

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

7 hours ago, AgentGamerPro said:

Do i need any addons? I get 2 errors:

cant understand this condition/effect: "open last gui to {_p}"

cant understand this condition "create new gui with virtual chest named "Melee Shop" with 3 rows:"

Yeah, sorry. You need TusKe.

rose city STICKER

RosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaR

i code, animate, develop, UI design, learn, and adapt, as well as make servers, of course

💐Joined Minehut sometime in 2014
💐VIP sometime in 2018
💐Legend in January 2021
💐Helper on 4/11/2021
💐♥ (Retired) on 5/17/2021
💐 Moderator on 8/18/2023

Link to comment
Share on other sites

Question answered. Topic locked.

Joined on January 17th 2016

VIP since April 5 2017 - August 1st 2019

JrMod since August 1st

Mod since October 1st

SrMod since November 2nd - 2/7/21

Patron since February 8 - 3/7/21

Mod since March 8 2021

Retired since idk when

 

    [IMG]    button.png?t=Appeal&f=Calibri-Bold&ts=26&tc=fff&tshs=1&tshc=000&hp=20&vp=8&c=10&bgt=gradient&bgc=1d0dea&ebgc=1a0855&be=1 button.png?t=Rules&f=Calibri-Bold&ts=26&tc=fff&tshs=1&tshc=000&hp=20&vp=8&c=10&bgt=gradient&bgc=1d0dea&ebgc=1a0855&be=1  

If I helped or entertained you at all today, please react with a heart.

Link to comment
Share on other sites

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