Solved Problem because the former is not an object

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

    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.

WorldMoney

Member
Mar 29, 2020
14
0
0
23
I maked a Skript. The Skript has a problem. The Skript should make the sender of a command to a variable.
Here's the Skript:
Code:
options:

        #Hier kannst du alles ändern
    SPIELMODUSNAME: &e&lAmpelrennen
    
        #Messages:
    
    KEINERECHTE: &cSorry du hast dafür keine Rechte!
    
    JOINMESSAGE: &6Du bist dem Spiel beigetreten
    
    LOBBYSETSPAWNMESSAGE: &6Der Lobby Spawnpunkt wurde erfolgreich gesetzt.
    
    ZIELSETSPAWNMESSAGE: &6Der Ziel Spawnpunkt wurde erfolgreich gesetzt.
    
    STARTSETSPAWNMESSAGE: &6Der Start Spawnpunkt wurde erfolgreich gesetzt.
    
    LEAVESETSPAWNMESSAGE: &6Du bist aus dem Spiel gegangen.
    
    LEAVEMESSAGE: &6Du bist aus dem Spiel gegangen.
    
    BEREITSIMSPIELMESSAGE: &6Du bist bereits im Spiel!
    
    INKEINSPIELERRORMESSAGE: &6Du bist momentan in keinen Spiel!
    
    #Hier darfst du nichts ändern!
    
command /ampelrennen [<text>] [<text>] [<string>]:
    trigger:
        if arg 1 is not set:
            send "-------------------------" to player
            send "&4&lCommands             " to player
            send "&6&l/ampelrennen <join,leave,admin,setspawn>" to player
            send "-------------------------" to player
        if arg 1 is "admin":
            if player has permission "ampel.admin":
                send "------------------------------------" to player
                send "&4Admin &lCommands " to player
                send "&6&l/ampelrennen setspawn <start,finish,lobby,leavepunkt>" to player
                send "&6&l/ampelrennen start" to player
                send "&6&l/ampelrennen stop" to player
                send "------------------------------------"
            else:
                send "{@KEINERECHTE}"
        if arg 1 is "setspawn":
            if arg 2 is not set:
                send "{@SPIELMODUSNAME} &6Bitte setze eine Syntax! /ampelrennen setspawn <start,finish,lobby,leavepunkt>" to player
            if player has permission "ampel.admin":
                if arg 2 is "start":
                    set {spawn.start} to location of player
                    send "{@SPIELMODUSNAME} {@STARTSETSPAWNMESSAGE}" to player
                if arg 2 is "finish":
                    set {spawn.finish} to location of player
                    send "{@SPIELMODUSNAME} {@ZIELSETSPAWNMESSAGE}" to player
                if arg 2 is "lobby":
                    set {spawn.lobby} to location of player
                    send "{@SPIELMODUSNAME} {@LOBBYSETSPAWNMESSAGE}" to player
                    send "{@SPIELMODUSNAME} &6Man wird nach dem Spiel immer wieder zu diesem Spawnpunkt teleportiert." to player
                if arg 2 is "leavepunkt":
                    set {spawn.leave} to location of player
                    send "{@SPIELMODUSNAME} {@LEAVESETSPAWNMESSAGE}" to player
                    send "{@SPIELMODUSNAME} &6Man wird, wenn man mit /ampelrennen leave aus dem Spiel geht, zu diesem Spawnpunkt teleportiert." to player
            else:
                send "{@KEINERECHTE}" to player
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add %sender% to {ampelrennen.spieler}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
        if arg 1 is "leave":
            if {join.%player%} is "1":
                remove 1 from {count.player.ampelrennen}
                remove %sender% from {ampelrennen.spieler}
                set {join.%player%} to "0"
                teleport player to {spawn.leave}
                send "{@LEAVEMESSAGE}" to player
            else if {join.%player%} is "0":
                send "{@INKEINSPIELERRORMESSAGE}"
        if arg 1 is "start":
            send "In 30 Sekunden startet das Spiel." to player
            wait 15 seconds
            send "In 15 Sekunden startet das Spiel." to player
            wait 5 seconds
            send "In 10 Sekunden startet das Spiel." to player
            wait 5 seconds
            send "In 5 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 4 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 3 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 2 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 1 Sekunden startet das Spiel." to player
            wait 1 second
            send "Jetzt wird das Spiel starten." to player
        if arg 1 is "stop":
            send "&cComming Soon" to player



right click on sign:
    if line 1 is "leave":
        if line 2 is "leave ampelrenne":
            execute player command "ampelrennen leave"
    if line 1 is "join":
        if line 2 is "join ampelrennen":
            execute player command "ampelrennen join"


if {count.player.ampelrennen} is greater than 1:
    send "In 30 Sekunden startet das Spiel." to player
    wait 15 seconds
    send "In 15 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 10 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 5 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 4 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 3 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 2 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 1 Sekunden startet das Spiel." to player
    wait 1 second
    send "Jetzt wird das Spiel starten." to player


on join:
    if {join.%player%} is not set:
        set {join.%player%} to "0"

on quit:
    if {join.%player%} is "1":
        teleport player to {spawn.leave}
        remove 1 from {count.player.ampelrennen}
        set {join.%player%} to "0"
            

            #STRINGS TEST
            
command /spawnstart:
    trigger:
        teleport player to {spawn.start}

command /spawnfinish:
    trigger:
        teleport player to {spawn.finish}

command /spawnlobby:
    trigger:
        teleport player to {spawn.lobby}
        
command /countplayers:
    trigger:
        send "%{count.player.ampelrennen}%"
        
command /joinplayer:
    trigger:
        send "%{join.%player%}%" to player
        
command /deletecount:
    trigger:
        delete {count.player.ampelrennen}
        
            #WERBUNG
            
on load:
    send "---------------------------" to console
    send "Dieses Plugin wurde von WorldMoney gecodet!" to console
    send "Dieses Plugin befindet sich in der BETA!" to console
    send "---------------------------" to console

And here's the Problem:
Code:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add %sender% to {ampelrennen.spieler}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
At add %sender% to {ampelrennen.spieler}
If i do in Minecraft /sk reload scripts than theres a Error: %sender% cant be added to {ampelrennen.spieler} because the sender is not an Object. How can i finish the Minigame when theres the error on the name counter of the Player that joins. When it doesent have the name of the player that joins then he became not the message that the Minigame starts
 
I maked a Skript. The Skript has a problem. The Skript should make the sender of a command to a variable.
Here's the Skript:
Code:
options:

        #Hier kannst du alles ändern
    SPIELMODUSNAME: &e&lAmpelrennen
   
        #Messages:
   
    KEINERECHTE: &cSorry du hast dafür keine Rechte!
   
    JOINMESSAGE: &6Du bist dem Spiel beigetreten
   
    LOBBYSETSPAWNMESSAGE: &6Der Lobby Spawnpunkt wurde erfolgreich gesetzt.
   
    ZIELSETSPAWNMESSAGE: &6Der Ziel Spawnpunkt wurde erfolgreich gesetzt.
   
    STARTSETSPAWNMESSAGE: &6Der Start Spawnpunkt wurde erfolgreich gesetzt.
   
    LEAVESETSPAWNMESSAGE: &6Du bist aus dem Spiel gegangen.
   
    LEAVEMESSAGE: &6Du bist aus dem Spiel gegangen.
   
    BEREITSIMSPIELMESSAGE: &6Du bist bereits im Spiel!
   
    INKEINSPIELERRORMESSAGE: &6Du bist momentan in keinen Spiel!
   
    #Hier darfst du nichts ändern!
   
command /ampelrennen [<text>] [<text>] [<string>]:
    trigger:
        if arg 1 is not set:
            send "-------------------------" to player
            send "&4&lCommands             " to player
            send "&6&l/ampelrennen <join,leave,admin,setspawn>" to player
            send "-------------------------" to player
        if arg 1 is "admin":
            if player has permission "ampel.admin":
                send "------------------------------------" to player
                send "&4Admin &lCommands " to player
                send "&6&l/ampelrennen setspawn <start,finish,lobby,leavepunkt>" to player
                send "&6&l/ampelrennen start" to player
                send "&6&l/ampelrennen stop" to player
                send "------------------------------------"
            else:
                send "{@KEINERECHTE}"
        if arg 1 is "setspawn":
            if arg 2 is not set:
                send "{@SPIELMODUSNAME} &6Bitte setze eine Syntax! /ampelrennen setspawn <start,finish,lobby,leavepunkt>" to player
            if player has permission "ampel.admin":
                if arg 2 is "start":
                    set {spawn.start} to location of player
                    send "{@SPIELMODUSNAME} {@STARTSETSPAWNMESSAGE}" to player
                if arg 2 is "finish":
                    set {spawn.finish} to location of player
                    send "{@SPIELMODUSNAME} {@ZIELSETSPAWNMESSAGE}" to player
                if arg 2 is "lobby":
                    set {spawn.lobby} to location of player
                    send "{@SPIELMODUSNAME} {@LOBBYSETSPAWNMESSAGE}" to player
                    send "{@SPIELMODUSNAME} &6Man wird nach dem Spiel immer wieder zu diesem Spawnpunkt teleportiert." to player
                if arg 2 is "leavepunkt":
                    set {spawn.leave} to location of player
                    send "{@SPIELMODUSNAME} {@LEAVESETSPAWNMESSAGE}" to player
                    send "{@SPIELMODUSNAME} &6Man wird, wenn man mit /ampelrennen leave aus dem Spiel geht, zu diesem Spawnpunkt teleportiert." to player
            else:
                send "{@KEINERECHTE}" to player
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add %sender% to {ampelrennen.spieler}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
        if arg 1 is "leave":
            if {join.%player%} is "1":
                remove 1 from {count.player.ampelrennen}
                remove %sender% from {ampelrennen.spieler}
                set {join.%player%} to "0"
                teleport player to {spawn.leave}
                send "{@LEAVEMESSAGE}" to player
            else if {join.%player%} is "0":
                send "{@INKEINSPIELERRORMESSAGE}"
        if arg 1 is "start":
            send "In 30 Sekunden startet das Spiel." to player
            wait 15 seconds
            send "In 15 Sekunden startet das Spiel." to player
            wait 5 seconds
            send "In 10 Sekunden startet das Spiel." to player
            wait 5 seconds
            send "In 5 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 4 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 3 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 2 Sekunden startet das Spiel." to player
            wait 1 second
            send "In 1 Sekunden startet das Spiel." to player
            wait 1 second
            send "Jetzt wird das Spiel starten." to player
        if arg 1 is "stop":
            send "&cComming Soon" to player



right click on sign:
    if line 1 is "leave":
        if line 2 is "leave ampelrenne":
            execute player command "ampelrennen leave"
    if line 1 is "join":
        if line 2 is "join ampelrennen":
            execute player command "ampelrennen join"


if {count.player.ampelrennen} is greater than 1:
    send "In 30 Sekunden startet das Spiel." to player
    wait 15 seconds
    send "In 15 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 10 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 5 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 4 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 3 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 2 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 1 Sekunden startet das Spiel." to player
    wait 1 second
    send "Jetzt wird das Spiel starten." to player


on join:
    if {join.%player%} is not set:
        set {join.%player%} to "0"

on quit:
    if {join.%player%} is "1":
        teleport player to {spawn.leave}
        remove 1 from {count.player.ampelrennen}
        set {join.%player%} to "0"
           

            #STRINGS TEST
           
command /spawnstart:
    trigger:
        teleport player to {spawn.start}

command /spawnfinish:
    trigger:
        teleport player to {spawn.finish}

command /spawnlobby:
    trigger:
        teleport player to {spawn.lobby}
       
command /countplayers:
    trigger:
        send "%{count.player.ampelrennen}%"
       
command /joinplayer:
    trigger:
        send "%{join.%player%}%" to player
       
command /deletecount:
    trigger:
        delete {count.player.ampelrennen}
       
            #WERBUNG
           
on load:
    send "---------------------------" to console
    send "Dieses Plugin wurde von WorldMoney gecodet!" to console
    send "Dieses Plugin befindet sich in der BETA!" to console
    send "---------------------------" to console

And here's the Problem:
Code:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add %sender% to {ampelrennen.spieler}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
At add %sender% to {ampelrennen.spieler}
If i do in Minecraft /sk reload scripts than theres a Error: %sender% cant be added to {ampelrennen.spieler} because the sender is not an Object. How can i finish the Minigame when theres the error on the name counter of the Player that joins. When it doesent have the name of the player that joins then he became not the message that the Minigame starts
Remove %% from "sender":

code_language.skript:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add sender to {ampelrennen.spieler}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
 
Status
Not open for further replies.