Skript Version: Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.11
---
Full Code:
Code (Skript):
and~
Errors on Reload:
Code (Skript):
Code (Skript):
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? Changing code around, to "soft" or "hard" return, etc.
Skript Author: Bensku
Minecraft Version: 1.11
---
Full Code:
Code (Skript):
code_language.skript:
function getcardWorth(p: player, t: text):
if {_t} is "1":
set {_Worth} to 1
if {_t} is "2":
set {_Worth} to 2
if {_t} is "3":
set {_Worth} to 3
if {_t} is "4":
set {_Worth} to 4
if {_t} is "5":
set {_Worth} to 5
if {_t} is "6":
set {_Worth} to 6
if {_t} is "7":
set {_Worth} to 7
if {_t} is "8":
set {_Worth} to 8
if {_t} is "9":
set {_Worth} to 9
if {_t} is "10" or "Jack" or "Queen" or "King":
set {_Worth} to 10
if {_t} is "Ace":
set {_Worth} to 11
add {_Worth} to {Worth}
return
code_language.skript:
function startBlackjack(p: player, i: integer):
open chest with 3 rows named "&c&lBlackjack" to {_p}
set {CardsLeft.%{_p}%} to 64
set {_cards} to {CardsLeft.%{_p}%}
setCardsLeft({_p}, {_cards})
set slot 12 of {_p}'s current inventory to a stick named "&c&lHit" with lore "||&cClick to gain a card!||&r"
set slot 14 of {_p}'s current inventory to a paper named "&a&lStay" with lore "||&rUse this to stay safe if you're within 3 of 21!||&r"
set {Blackjack.%{_p}%} to 18
set {Count.%{_p}%} to 0
loop 2 times:
set {_CardType} to random element out of {CardTypes::*}
set {_CardSpecify} to random element out of {CardList::*}
set {_CardGained} to "%{CardColor::%{_CardType}%}% %{_CardSpecify}% of %{_CardType}%"
set {_s} to {Blackjack.%{_p}%}
set slot {_s} of {_p}'s current inventory to a paper named "&a%{_CardGained}%" with lore "||&7Default Cards"
add 1 to {Blackjack.%{_p}%}
subtract 1 from {CardsLeft.%{_p}%}
set {_c} to {CardsLeft.%{_p}%}
setCardsLeft({_p}, {_c})
set {_test} to {_CardSpecify}
getcardWorth({_p}, "%{_c}%")
add {_Worth} to {_TestWorth::*}
Errors on Reload:
Code (Skript):
- Return can only go in Functions (or something similar)
Code (Skript):
- N/A
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? Changing code around, to "soft" or "hard" return, etc.