Solved Detecting Sign Lines under a block and then giving an effect using it

  • 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.

DiufoemHD

Member
May 29, 2018
3
0
0
Skript Version: Latest
Skript Author: None
Minecraft Version: 1.12.2

---
Full Code:
code_language.skript:
every tick:
    loop all players:
        loop-player is in world "staffevent"
        if block below loop-player is red clay:
            kill loop-player
        if block below loop-player is light green clay:
            if the block under the block below loop-player is a sign:
                set {_strength} to "%line 1 of block under the block below loop-player%" parsed as number
                set {_duration} to "%line 2 of block under the block below loop-player%" parsed as number
                apply potion of leaping of tier {_strength} to loop-player for {_duration} seconds
            else:
                send "&cPlease format the sign below the effect block:" to loop-player
                send "&cLine 1 = Amplifier" to loop-player
                send "&cLine 2 = Duration in seconds" to loop-player

Errors on Reload:

code_language.skript:
There's no loop that matches 'loop-player for {_duration} seconds'
Other Useful Info: taking away the parse does nothing. Also, the first part about the red clay works fine.

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it?

None lol
 
ok I did a few things here.
First of all, i removed the parsing, wasn't necessary.
Next. I added in another variable, for some reason it was having a problem with loop-player and your time span, so I made a second time span, that should work
Also, potion of leaping i dont think is a thing in Skript, so I changed it to "jump boost"

code_language.skript:
every tick:
    loop all players:
        if loop-player is in world "staffevent":
            if block below loop-player is red clay:
                kill loop-player
            if block below loop-player is light green clay:
                if the block under the block below loop-player is a sign:
                    set {_strength} to line 1 of block under the block below loop-player
                    set {_duration} to line 2 of block under the block below loop-player
                    set {_time} to "%{_duration}% seconds"
                    apply potion of jump boost of tier {_strength} to loop-player for {_time}
                else:
                    send "&cPlease format the sign below the effect block:" to loop-player
                    send "&cLine 1 = Amplifier" to loop-player
                    send "&cLine 2 = Duration in seconds" to loop-player
[doublepost=1528053153,1528053103][/doublepost]OH BTW,,,, I haven't tested this in game, but I tested it with a console, it ran NO errors
 
Status
Not open for further replies.