GUI setting Value with Chat Error

  • 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 community!

    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.

CormanYT

Active Member
Jan 6, 2018
122
5
18
Now, this doesn't give me any error, but it doesn't let me accomplish what I want it to do.
- I want to click the "Starting Value" part of the configuration and it'll send me What would you like to change <variable> to? Then, I type the value and it sends me <variable> has been changed to <message>. Currently, this is my code:

code_language.skript:
on chat:
    if {iBasics.config-list::*} contains player:
        set {iBasics.config-output::%player%} to message
        remove player from {iBasics.config-list::*}
function setVar(v: String , p: Player):
    set {iBasics.config-output::%{_p}%} to false
    send "&6What would you like to set &c%{_v}% &6to?" to {_p}
    add {_p} to {iBasics.config-list::*}
    while {iBasics.config-output::%{_p}%} is false:
        wait 4 ticks
    set {iBasics.config::%{_v}%} to {iBasics.config-output::%{_p}%}
    send "&6Successfully set &c%{_v}% to %{iBasics.config-output::%{_p}%}%" to {_p}
function menuOpen(n: String , p: Player):
    if {_n} is "economy-config":
        open virtual chest inventory named "&2iBasics > Economy > Config" to {_p}
        format gui slot 0 of {_p} with paper named "&eStarting Balance" with lore "&8Value:&a %{iBasics.config::startingbal}%" to run function setVar ("startingbal" , player)
        format gui slot 1 of {_p} with paper named "&eMinimum Balance" with lore "&8Value:&a %{iBasics.config::minbal}%"
        format gui slot 2 of {_p} with paper named "&eMaximum Balance" with lore "&8Value:&a %{iBasics.config::maxbal}%"
        format gui slot 3 of {_p} with paper named "&eCurrency Symbol" with lore "&8Value:&a %{iBasics.config::currencysymbol}%"
        format gui slot 22 of {_p} with paper named "&c&lBack" to run function menuOpen ("economy" , {_p})

What I am using: For this, I've been using Skript and TuSKE. However, I also have SkQuery (Lime), and I wouldn't be mad if I have to download another addon. Thanks!
 
What exactly doesn't work? Try this maybe
code_language.skript:
on chat:
    if "%{iBasics.config-list::*}%" contains "%player%":
        set {iBasics.config-output::%player%} to message
        set {_v} to {iBasics::chat-set::%player%}
        set {iBasics.config::%{_v}%} to {iBasics.config-output::%player%}
        remove player from {iBasics.config-list::*}
        send "&6Successfully set &c%{_v}% to %{iBasics.config-output::%player%}%"
        delete {iBasics::chat-set::%player%}

function setVar(v: String , p: Player):
    set {iBasics.config-output::%{_p}%} to false
    set {iBasics::chat-set::%{_p}%} to {_v}
    send "&6What would you like to set &c%{_v}% &6to?" to {_p}
    add {_p} to {iBasics.config-list::*}
 
What exactly doesn't work? Try this maybe
code_language.skript:
on chat:
    if "%{iBasics.config-list::*}%" contains "%player%":
        set {iBasics.config-output::%player%} to message
        set {_v} to {iBasics::chat-set::%player%}
        set {iBasics.config::%{_v}%} to {iBasics.config-output::%player%}
        remove player from {iBasics.config-list::*}
        send "&6Successfully set &c%{_v}% to %{iBasics.config-output::%player%}%"
        delete {iBasics::chat-set::%player%}

function setVar(v: String , p: Player):
    set {iBasics.config-output::%{_p}%} to false
    set {iBasics::chat-set::%{_p}%} to {_v}
    send "&6What would you like to set &c%{_v}% &6to?" to {_p}
    add {_p} to {iBasics.config-list::*}
That doesn't work. To answer your question

What doesn't work? When I click Starting Balance, it doesn't send me a message. It also won't get my chat response and set the value of the variable to that.
 
Try this (instead of your previous format gui slot ofcourse):
code_language.skript:
format gui slot 0 of {_p} with paper named "&eStarting Balance" with lore "&8Value:&a %{iBasics.config::startingbal}%" to run function setVar("startingbal", player)
 
Try this (instead of your previous format gui slot ofcourse):
code_language.skript:
format gui slot 0 of {_p} with paper named "&eStarting Balance" with lore "&8Value:&a %{iBasics.config::startingbal}%" to run function setVar("startingbal", player)
That doesn't work either.
 
Status
Not open for further replies.