question

plenouveau avatar image
plenouveau asked

Grant Item to user by Cloudscript and change the metadata

Hi!

I want to call a script with Unity in Cloudscript to grant an item to a user, change its metadata and send it back to Unity, but whenever i try to grant an item to myself in Cloudscript it returns a null in unity whatever I try to return even if it's only strings,

Maybe I am missing something? I am not super used with Cloudscript yet, wondering if you guys could help me.

Here is the script for reference(for now I returned some strings to test, but I would want to return the item instance or its values in some way):

unity3dCloudScript
exam1.png (66.3 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Can you try putting a breakpoint in, to see what the values coming back are? Using that exact script in my own test title, and passing in "foo" for name and "bar" for link returns this in my test:

{
    "FunctionResult": {
        "url": "foo",
        "vpn": "bar",
        "returnTrue": "true"
    },
    "Logs": [
        {
            "Level": "Info",
            "Message": "foo",
            "Data": null
        }
    ],
    "ExecutionTimeSeconds": 0.0005932,
    "MemoryConsumedBytes": 14600,
    "APIRequestsIssued": 0,
    "HttpRequestsIssued": 0,
    "Error": null
}
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.