btk5h / skript-json

JSON support for Skript
MIT License
9 stars 1 forks source link

Change after set variable #10

Closed Matgsam closed 5 years ago

Matgsam commented 5 years ago

How can I change the value after setting the variable?

{"network":"SURVIVAL","vanish":0} < Inside of variable {network::%player%} < Variable

I want to change the value "vanish"

btk5h commented 5 years ago

I don't think I understand your question. Can you provide a code sample of what you expect to work?

Matgsam commented 5 years ago

this is my code: set {sql_punishment::%arg 1%} to "{""id"":""%{_id}%"",""network"":""SURVIVAL"",""type"":""%{_type}%"",""category"": ""%arg 2%"",""durationstamp"":""%{_timestamp}%"",""duration"":""%{_duration}%"",""custom_reason"": ""%{_reason}%"",""proof"": ""%{_proof}%"",""unban_staffer"": -1,""unban_reason"": ""Não informado."",""unban_category"":""null"",""perpetual"":%{_perpetual}%,""created_at"":""%day%/%month%/%year% às %hour%:%minute%"",""end"":""%{_end}%"",""status"":""%{_status}%"",""user"":""%arg 1%"",""staffer"":""%sender%""}"

I just set the variable like that, but I wanted to change a value after define a variable, example: set {sql_punishment::%sender%::status} to "Finished"

Matgsam commented 5 years ago

can you do that?

btk5h commented 5 years ago

I still don't understand your question. Nothing you've asked requires any skript-json. You can just set variables when you need to set them.

Matgsam commented 5 years ago

I use skript-json to store multiple information in one variable, but how do I change the value of one of this information?

btk5h commented 5 years ago

So you used skript-json to convert a list variable to JSON, correct? You would just do that step again.

Matgsam commented 5 years ago

copy json {sql_punishment::%arg 1%} to {_output::*}

this way? when i use this method it changes and then comes back because this variable is temporary

btk5h commented 5 years ago

It sounds like you might have a misunderstanding about how Skript variables work in general. I'm going to close this issue since this issue tracker is meant more for feature requests/bug reports rather than support questions.

Please continue this in the Skript discord server.