Solved Funtions dont work

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Brok3nmind

Active Member
Feb 3, 2017
66
1
8
22
Germany
darkvoid.eu
[SOLVED]

Game version: 1.13.2
Skript: 2.3 beta 4

code_language.skript:
command /lol:
    trigger:
        something(player)

function something(p: player):
    loop 1 times:
        loop all items in {_p}'s inventory:
            if {_p} has 6 Ice:
                if {_p} has 21 Diamond:
                    send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
                    remove 21 diamond from {_p}'s inventory
                    remove 6 ice from {_p}'s inventory
                    add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
                    stop
 
Last edited:
Game version: 1.13.2
Skript: 2.3 beta 4

code_language.skript:
command /lol:
    trigger:
        something(player)

function something(p: player):
    loop 1 times:
        loop all items in {_p}'s inventory:
            if {_p} has 6 Ice:
                if {_p} has 21 Diamond:
                    send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
                    remove 21 diamond from {_p}'s inventory
                    remove 6 ice from {_p}'s inventory
                    add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
                    stop
show code and errors?
 
show code
code_language.skript:
function something(p: player):
    loop 1 times:
        loop all items in {_p}'s inventory:
            if {_p} has 6 Ice:
                if {_p} has 21 Diamond:
                    send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
                    remove 21 diamond from {_p}'s inventory
                    remove 6 ice from {_p}'s inventory
                    add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
                    stop
command /lol:
    trigger:
        something(player)

I become that https://gyazo.com/190411c66bb406f824043e089fa10126
 
code_language.skript:
function something(p: player):
    loop 1 times:
        loop all items in {_p}'s inventory:
            if {_p} has 6 Ice:
                if {_p} has 21 Diamond:
                    send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
                    remove 21 diamond from {_p}'s inventory
                    remove 6 ice from {_p}'s inventory
                    add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
                    stop
command /lol:
    trigger:
        something(player)

I become that https://gyazo.com/190411c66bb406f824043e089fa10126

code_language.skript:
function something(p: player):
 if {_p} has 6 Ice:
  if {_p} has 21 Diamond:
   send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
   remove 21 diamond from {_p}'s inventory
   remove 6 ice from {_p}'s inventory
   add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
  
command /lol:
 trigger:
  something(player)
 
```
function something(p: player):
if {_p} has 6 Ice:
if {_p} has 21 Diamond:
send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
remove 21 diamond from {_p}'s inventory
remove 6 ice from {_p}'s inventory
add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}

command /lol:
trigger:
something(player)
```
It still dont works
 
It still dont works
code_language.skript:
function something(p: player):
 broadcast "1"
 if {_p} has 6 Ice:
  broadcast "2"
  if {_p} has 21 Diamond:
   broadcast "3"
   send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
   remove 21 diamond from {_p}'s inventory
   remove 6 ice from {_p}'s inventory
   add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
  
command /lol:
 trigger:
  something(player)

What does it return?
 
code_language.skript:
function something(p: player):
 broadcast "1"
 if {_p} has 6 Ice:
  broadcast "2"
  if {_p} has 21 Diamond:
   broadcast "3"
   send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
   remove 21 diamond from {_p}'s inventory
   remove 6 ice from {_p}'s inventory
   add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
 
command /lol:
 trigger:
  something(player)

What does it return?
Only 1
 
mmmm weird seems like a bug try:

code_language.skript:
function something(p: player):
 broadcast "1"
 if "%{_p}%" parsed as a player has 6 Ice:
  broadcast "2"
  if "%{_p}%" parsed as a player has 21 Diamond:
   broadcast "3"
   send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
   remove 21 diamond from {_p}'s inventory
   remove 6 ice from {_p}'s inventory
   add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
 
command /lol:
 trigger:
  something(player)
 
  • Like
Reactions: Brok3nmind
mmmm weird seems like a bug try:

code_language.skript:
function something(p: player):
 broadcast "1"
 if "%{_p}%" parsed as a player has 6 Ice:
  broadcast "2"
  if "%{_p}%" parsed as a player has 21 Diamond:
   broadcast "3"
   send "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword" to {_p}
   remove 21 diamond from {_p}'s inventory
   remove 6 ice from {_p}'s inventory
   add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to {_p}
 
command /lol:
 trigger:
  something(player)
That work, thank that you helped me!
 
  • Like
Reactions: Lego_freak1999
Status
Not open for further replies.