a weird way to teleport players but it wont work

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

yogurtff

Member
Jan 26, 2025
33
3
8
This doesnt work for the normal players
Code:
on break:
    if event-block is gold block:
        send "any argument possible" to player
        set event-block to gold block
        set {_brandom} to a random integer between 1 and 3
        if {_brandom} = 1:
            teleport player to location(18.500,-37,56.500)
        else if {_brandom} = 2:
            teleport player to location(25.500,-37,53.500)
        else if {_brandom} = 3:
            teleport player to location(10.500,-37,57.500)
    else:
            cancel event

When the player is an op, it works perfectly.
what am i doing wrong?
 
If you have SkBee, try on mine instead of on break.
If that doesn't work, try on break of gold block

And the line set event-block to gold block was unnecessary in your code.
 
Last edited:
If you have SkBee, try on mine instead of on break.
If that doesn't work, try on break of gold block

And the line set event-block to gold block was unnecessary in your code.
im only using skript
if i dont add
Python:
set event-block to gold block
then the block wont appear. when i add cancel event rest of the code wont work.
ill test "on break of gold block" but i didnt send the whole code cuz the code i sent to u was the only part which wont work
 
Interesting, it's working perfectly on me without the set event-block to gold block, even when deopped.
here is the whole code:
Python:
on break:
    if event-block is gold block:
        send "test" to player
        set event-block to gold block
        set {_brandom} to a random integer between 1 and 3
        if {_brandom} = 1:
            teleport player to location(18.500,-37,56.500)
        else if {_brandom} = 2:
            teleport player to location(25.500,-37,53.500)
        else if {_brandom} = 3:
            teleport player to location(10.500,-37,57.500)
    else if event-block is coal ore:
        make console execute command "/economy give %player% 1"
        send "&a+$1" to player
        set {_random} to a random integer between 1 and 3
        if {timer.coal} = 0:
            set {timer.coal} to 30
            if {_random} = 1:
                spawn a wither skeleton at location(13.500,-37,48.500)
                send "Wither İskeleti '13, -37, 48' kordinatında çıktı." to all players
            else if {_random} = 2:
                spawn a wither skeleton at location(30.500,-37,59.500)
                send "Wither İskeleti '30, -37, 59' koordinatında çıktı." to all players
            else if {_random} = 3:
                spawn a wither skeleton at location(15.500,-37,61.500)
                send "Wither İskeleti '15, -37 61' koordinatında çıktı." to all players
        set event-block to bedrock
        wait 15 seconds
        set event-block to coal ore
    else:
        cancel event

now idk whats happening with the gold block
 
There.
CSS:
on break:
    if event-block is gold block:
        set {_brandom} to a random integer between 1 and 3
        if {_brandom} = 1:
            teleport player to location(18.500,-37,56.500)
        else if {_brandom} = 2:
            teleport player to location(25.500,-37,53.500)
        else if {_brandom} = 3:
            teleport player to location(10.500,-37,57.500)

    else if event-block is coal ore:
        make console execute command "/economy give %player% 1"
        send "&a+$1" to player
        set {_random} to a random integer between 1 and 3
        if {timer.coal} = 0:
            set {timer.coal} to 30
            if {_random} = 1:
                spawn a wither skeleton at location(13.500,-37,48.500)
                send "Wither İskeleti '13, -37, 48' koordinatında çıktı." to all players
            else if {_random} = 2:
                spawn a wither skeleton at location(30.500,-37,59.500)
                send "Wither İskeleti '30, -37, 59' koordinatında çıktı." to all players
            else if {_random} = 3:
                spawn a wither skeleton at location(15.500,-37,61.500)
                send "Wither İskeleti '15, -37 61' koordinatında çıktı." to all players
        set event-block to bedrock
        wait 15 seconds
        set event-block to coal ore

    else:
        cancel event

But the problem is, it cancels everything else other than coal and gold blocks. Was this intentional?
 
There.
CSS:
on break:
    if event-block is gold block:
        set {_brandom} to a random integer between 1 and 3
        if {_brandom} = 1:
            teleport player to location(18.500,-37,56.500)
        else if {_brandom} = 2:
            teleport player to location(25.500,-37,53.500)
        else if {_brandom} = 3:
            teleport player to location(10.500,-37,57.500)

    else if event-block is coal ore:
        make console execute command "/economy give %player% 1"
        send "&a+$1" to player
        set {_random} to a random integer between 1 and 3
        if {timer.coal} = 0:
            set {timer.coal} to 30
            if {_random} = 1:
                spawn a wither skeleton at location(13.500,-37,48.500)
                send "Wither İskeleti '13, -37, 48' koordinatında çıktı." to all players
            else if {_random} = 2:
                spawn a wither skeleton at location(30.500,-37,59.500)
                send "Wither İskeleti '30, -37, 59' koordinatında çıktı." to all players
            else if {_random} = 3:
                spawn a wither skeleton at location(15.500,-37,61.500)
                send "Wither İskeleti '15, -37 61' koordinatında çıktı." to all players
        set event-block to bedrock
        wait 15 seconds
        set event-block to coal ore

    else:
        cancel event

But the problem is, it cancels everything else other than coal and gold blocks. Was this intentional?

yes, i want it to cancel everything else other than coal and gold blocks, because its like a farming game lol. and it still wont work
 
How abnormal. It's working perfectly on me.
What's interesting is, the code doesn't require any add-ons like I have on my server. Can you show me the screenshot of what syntax error it gives?
 
How abnormal. It's working perfectly on me.
What's interesting is, the code doesn't require any add-ons like I have on my server. Can you show me the screenshot of what syntax error it gives?
it gives no errors. it just doesnt work.
 
Code:
on break:
    if event-block is gold block:
        set event-block to gold block
        set {_brandom} to a random integer between 1 and 6
        if {_brandom} = 1:
            make console execute command "teleport %player% 18.500 -37 56.500"
        else if {_brandom} = 2:
            make console execute command "teleport %player% 25.500 -37 53.500"
        else if {_brandom} = 3:
            make console execute command "teleport %player% 10.500 -37 57.500"
        else if {_brandom} = 4:
            make console execute command "teleport %player% 29.500 -37 97.500"
        else if {_brandom} = 5:
            make console execute command "teleport %player% 22.500 -37 88.500"
        else if {_brandom} = 6:
            make console execute command "teleport %player% 5.500 -37 101.500"

this doesnt work somehow, but works for op's yet again
 
I don't think Skript is the issue here, it's working perfectly fine on my server without being operator. You might wanna check the permissions. The code works flawlessly.
 
I don't think Skript is the issue here, it's working perfectly fine on my server without being operator. You might wanna check the permissions. The code works flawlessly.
can you help me with that? what permissions r u talking about? is it about essentials maybe?