Jump to content

Function In Function


AgentGamerPro

Recommended Posts

How do i call a function while im calling it in a function
The first part of the skript is in a function

format slot 11 of {_p} with wooden sword named "&f&lWooden Sword" with lore "" and "&6300 Coins" to close then run [BuyWoodSword({_p})]

The second is a function being called in a function

function BuyWoodSword(p: player):
	set {_u} to uuid of {_p}
	if {balance::%{_u}%} >= 300:
		remove 300 from {balance::%{_u}%}
		give wooden sword to {_p}
		send "&aSuccessfully purchased &2Wooden Sword!" to {_p}
	else:
		send "&4&lError: &cInsufficent Balance!" to {_p}

EDIT: i don't get any errors but when i click the sword, it closes but dosent do anything

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

first of all, you should use this gui slot format instead:

 

 format gui slot (slot) with (item) named "(name)" with lore "(lore) to run:

    #stuff

 

this might be a potential fix to your problem, as skript (most of the time) doesnt allow you to put multiple different functions after one another if they are used in an inventory click situation. Try using the format i gave you above and it might work.

 

    

Link to comment
Share on other sites

14 hours ago, Sh0ot said:

first of all, you should use this gui slot format instead:

 

 format gui slot (slot) with (item) named "(name)" with lore "(lore) to run:

    #stuff

 

this might be a potential fix to your problem, as skript (most of the time) doesnt allow you to put multiple different functions after one another if they are used in an inventory click situation. Try using the format i gave you above and it might work.

 

    

"can't understand this condition/effect"

EDIT: I fixed it, so im fine now

Edited by AgentGamerPro
see "EDIT"

 

 

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

You can also do:

format gui slot (slot) of (player) with (item info) to run function (function)

Sorry, I couldn’t put that in a code box because there’s no support for that on phones.

» IGN: _iZ_ «

» Joined: 12/18/2016 «

» VIP: 1/13/2018 «

» Helper: 1/29/2021 «

» [<3]: 5/8/2021 «

» Skript dev «

» Discord: iZz#0420 «

I have diabetes

React to this if I was helpful, found this interesting, or you're just nice 🙂

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...