Solved Wait {_w} seconds

  • 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.
Apr 12, 2017
36
0
0
I am working on making a simple brick furnace skript, but it is returning errors
code_language.skript:
function smelt(p: player):
    set {_i} to {_p}'s tool
    {_i} is an ore
    send "test" to {_p}
    set {_a} to amount of {_p}'s tool
    if {_i} is iron ore:
        remove {_a} of {_i} from {_p}
        send "%{_a}%" to {_p}
        set {_w} to 0.5*{_a}
        send "%{_w}%" to {_p}
        wait {_w} seconds
        give {_p} {_a} of iron ingots

The error it is returning says that it doesn't understand the effect "wait {_w} seconds". Is this error caused by the Function having a wait?
 
I am working on making a simple brick furnace skript, but it is returning errors
code_language.skript:
function smelt(p: player):
    set {_i} to {_p}'s tool
    {_i} is an ore
    send "test" to {_p}
    set {_a} to amount of {_p}'s tool
    if {_i} is iron ore:
        remove {_a} of {_i} from {_p}
        send "%{_a}%" to {_p}
        set {_w} to 0.5*{_a}
        send "%{_w}%" to {_p}
        wait {_w} seconds
        give {_p} {_a} of iron ingots

The error it is returning says that it doesn't understand the effect "wait {_w} seconds". Is this error caused by the Function having a wait?
Maybe try using
code_language.skript:
 wait "%{_w}%" seconds
 
i tried a million different ways, and it seems you can use a variable for a wait time, that seems odd.
Might have to report that to Bensku for a skript update!

I just submitted an issue for this on Github, because I feel like that SHOULD work
 
i tried a million different ways, and it seems you can use a variable for a wait time, that seems odd.
Might have to report that to Bensku for a skript update!

I just submitted an issue for this on Github, because I feel like that SHOULD work
Thank you for submitting it for me!
 
Youre welcome, so i figured out the problem here, and why its not working.
So the syntax is
Which means you cant do "wait {_w} seconds" you would have to do something like "wait {_w}" so you have to be able to set your variable to be seconds/time spawn
[doublepost=1525551555,1525550972][/doublepost]ok, SO I FIXED IT

do something like this
code_language.skript:
set {_neww} to "%{_w}% seconds" parsed as timespan
wait {_neww}
This will set {_neww} as your {_w} but parsed as a time span in seconds
[doublepost=1525551848][/doublepost]ALSO.... when I ran your function i got this error
"[13:22:09 ERROR]: 'the tool of {_p}' can only ever have one value at most, thus the 'amount of ...' expression is useless. Use '... exists' instead to find out whether the expression has a value. (test.sk, line 7: set {_a} to amount of {_p}'s tool')"

A simple fix to that is change this:
code_language.skript:
set {_a} to amount of {_p}'s tool

to this:
code_language.skript:
    set {_tool} to {_p}'s tool
    set {_a} to the amount of {_tool} in {_p}'s inventory
 
  • Like
Reactions: Stegoleopluradon2
Status
Not open for further replies.