#Can I make a inventory check?

1 messages · Page 1 of 1 (latest)

flint cave
#

Due to custom crafting system it can bug out if someone craft something but the inventory is full.

Is there an inventory check?

I tried this but it doesn't work:

player has 1 empty inventory slot

deep ingot
#

player has space for [item]

flint cave
#

It really needs to be the item?

Can't be with 1 empty slot?

flint cave
# deep ingot player has space for [item]

I know this works but will take a lot of time to implement it in the code rn.

Also we have a max of 3 items in 1 slot (for example 3 dirt and when you get 1 more dirt it will take another inv space)

shut root
shut root
#

not sure if it takes into account armor slots & crafting slots

#

u will have to do some testing

flint cave
#

[23:38:47 INFO]: [Skript] Reloading MNR - Selmer2.sk...
[23:38:51 INFO]: Line 3175: (MNR - Selmer2.sk)
[23:38:51 INFO]: Can't understand this condition/effect: if player has enough space for 1 bedrock
[23:38:51 INFO]: Line: if player has enough space for 1 bedrock
[23:38:51 INFO]:
[23:38:51 INFO]: Encountered 1 error while reloading MNR - Selmer2.sk! (3920ms)

shut root
#

weird player has enough space for 64 feathers is the official example

#

so im not sure why 1 bedrock wouldnt work

#

maybe try bedrock instead of 1 bedrock

#

oh wait

#

i see the issue

#

you did not add a colon

#

at the end of the line

flint cave
#

Got it working without the "if"

shut root
#

ah you're not doing indented if statements

flint cave
#
            if {_p} has {@stickrecipe}:
                make gui slot 3 to stick named "&a&lCraft Stick" with lore "&7Het benodigde level hiervoor is &22&7." and "" and "&fBenodigde voorwerpen:" and "&21 &aPlanks":
                    if {houthakkercraftingcooldown.%{_p}%} is not greater than now:
                        if {_p} has 1 oak planks:
                            close {_p}' inventory
                            player has enough space for 1 bedrock
                            remove 1 oak planks from {_p}' inventory
                            give 1 stick to {_p}
                            set {_cooldown} to CooldownCheck({_p})
                            set {_cooldown2} to "%{_cooldown}% seconds" parsed as timespan
                            set {houthakkercraftingcooldown.%{_p}%} to {_cooldown2} from now
                            if {xpbooster} is 0:
                                remove {@PuntenStickHH} from {puntenresterend::houthakker::%uuid of player%}
                            else:
                                set {_rest} to (100+{xpbooster})
                                set {_punten} to (({@PuntenStickHH}/100)*{_rest})
                                set {_puntenFinal} to round({_punten})
                                remove {_puntenFinal} from {puntenresterend::houthakker::%uuid of player%}
                            set {_team} to {team.%player%}
                            if {xpbooster} is 0:    
                                remove {@PuntenStickHH} from {resterendeteampunten.%{_team}%}
                            else:
                                set {_rest} to (100+{xpbooster})
                                set {_punten} to (({@PuntenStickHH}/100)*{_rest})
                                set {_puntenFinal} to round({_punten})
                                remove {_puntenFinal} from {resterendeteampunten.%{_team}%}
                            stop```
#

This is an example of a custom recipe with boosters (every crafting can get you points (translated of Punten)

#

Can I also add a text that you don't have enough inventory space?

shut root
#

yeah you would need to use indented if statements

#

like you did in other parts of the code

#

instead of inline

flint cave
#

Where can I add it?

shut root
#

?

#

did you not write the code above?

flint cave
#

I did with a mate of mine

shut root
#

ah that explains it

flint cave
#

He's currently not here

shut root
#

you need to use an if else statements

#

like you friend did in other parts of the code

flint cave
#

Thanks for the help tho!

deep ingot
fervent sky
deep ingot
fervent sky
deep ingot
#

Idd

flint cave
fervent sky
flint cave
#

Ja maar snap je uitspraak niet

fervent sky
#

Nederland is een kutland

deep ingot
#

Alles is gwn in random weiland

#

Niemand ziet het verschil tussen Groningen, Limburg en zeeland

#

Of welke plek dan ook

fervent sky
#

En dan ook al die buitenlanders, te veel

novel nova
#

like a bed

deep ingot
#

Helft van winkel medewerkers praten geen nl