Boat Race Mini Game

  • 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.
Feb 6, 2021
1
0
1
23
Hello,
I am currently working on a boat racing mini game. But I ran into the problem that I don't know how to do the checkpoints and the start.
The checkpoints and the start should be able to be set by command and it should also be possible to check whether a player has passed through the chackpoint.


This is my current Code: (Not completed and tested yet!)
Code:
#========================================================================
#                    Create Track
#========================================================================
Command /newTrack <string>:
    description: Create a new Track
    permission: op
    trigger:
        if {track::%arg-1%} is not set:
            set {track::%arg-1%} to location of player
            set {playercount::%arg-1%} to 0
            set {maxplayers::%arg-1%} to 0
            message "The Track <light cyan>%arg-1%<reset> has been created!"
        else:
            message "The track <light cyan>%arg-1%<reset> is already existing!"

#========================================================================
#                    Start Positiones
#========================================================================

Command /setStartPos <string> <number>:
    description: Set one start position
    permission: op
    trigger:
        if {StartPos::%arg-1%::%arg-2%} is not set:
            if {track::%arg-1%} is set:
                set {StartPos::%arg-2%::%arg-1%} to location of player
                add {maxplayers::%arg-1%} 1
                message "Set the Start position <light cyan>%arg-2%<reset> to the track <light cyan>%arg-1%!"
            else:
                message "The track <light cyan>%arg-1%<reset> is not existing!"
        else:
            message "The Start position <light cyan>%arg-2%<reset> is already set for the track <light cyan>%arg-1%<reset>!"

#========================================================================
#                     Delete Start Positiones
#========================================================================

Command /delStartPos <string> <number>:
    description: Delete a start position.
    permission: op
    trigger:
        if {StartPos::%arg-2%::%arg-1%} is set:
            if {track:: %arg-2%} is set:
                delete {StartPos::%arg-2%::%arg-1%}
                remove {maxplayers::%arg-1%} 1
                message "Removed the Start position <light cyan>%arg-2%<reset> ofthe track <light cyan>%arg-1%<reset>!"
            else:
                message "The track <light cyan>%arg-2%<reset> is not existing!"
        else:
            message "The Start position %arg-1% is not set for the track <light cyan>%arg-2%<reset>!"

#========================================================================
#                     Show Start Positiones
#========================================================================


Command /startPositiones <string>:
    description: Showes you
    permission: op
    trigger:
        if {track::%arg-1%} is set:
            message "These are the set starting positions of the track <light cyan>%arg-1%"
            if {StartPos::%arg-1%::1} is set:
                message "Start Position 1 is set to <grey>{StartPos::%arg-1%::1}<reset>!"
            else:
                message "Start <light cyan> Position 1<reset> is not set!"
            if {StartPos::%arg-1%::2} is set:
                message "Start Position 2 is set to <grey>{StartPos:: %arg-1%::2}<reset>!"
            else:
                message "Start <light cyan> Position 2<reset> is not set!"
            if {StartPos::%arg-1%::3} is set:
                message "Start Position 3 is set to <grey>{StartPos::3::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 3<reset> is not set!"
            if {StartPos::%arg-1%::4} is set:
                message "Start Position 4 is set to <grey>{StartPos::4::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 4<reset> is not set!"
            if {StartPos::%arg-1%::5} is set:
                message "Start Position 5 is set to <grey>{StartPos::5::%arg-1%}<reset>!”
            else:
                message "Start <light cyan> Position 5<reset> is not set!"
            if {StartPos::%arg-1%::6} is set:
                message "Start Position 6 is set to <grey>{StartPos::6::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 6<reset> is not set!"
            if {StartPos::%arg-1%::7} is set:
                message "Start Position 7 is set to <grey>{StartPos::7::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 7<reset> is not set!"
            if {StartPos::%arg-1%::8} is set:
                message "Start Position 8 is set to <grey>{StartPos::8::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 8<reset> is not set!”
            if {StartPos::%arg-1%::9} is set:
                message "Start Position 9 is set to <grey>{StartPos::9::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 9<reset> is not set!"
            if {StartPos::%arg-1%::10} is set:
                message "Start Position 10 is set to <grey>{StartPos::10::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 10<reset> is not set!"
            if {StartPos::%arg-1%::11} is set:
                message "Start Position 11 is set to <grey>{StartPos::11::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 11<reset> is not set!"
            if {StartPos::%arg-1%::12} is set:
                message "Start Position 12 is set to <grey>{StartPos::12::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 12<reset> is not set!"
            if {StartPos::%arg-1%::13} is set:
                message "Start Position 13 is set to <grey>{StartPos::13::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 13<reset> is not set!"
            if {StartPos::%arg-1%::14} is set:
                message "Start Position 14 is set to <grey>{StartPos::14::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 14<reset> is not set!"
            if {StartPos::%arg-1%::15} is set:
                message "Start Position 15 is set to <grey>{StartPos::15::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 15<reset> is not set!"
            if {StartPos::%arg-1%::16} is set:
                message "Start Position 16 is set to <grey>{StartPos::16::%arg-1%}<reset>!"
            else:
                message "Start <light cyan> Position 16<reset> is not set!"

#========================================================================
#                     Create Start/Finish
#========================================================================

Command /setStart <string>:
    description: Starts the game
    permission: op
    trigger:
        add %arg-1% to {StartFinish::list::*}
        

on region enter:
player is in the region {StartFinish::list::*}
    message "You are in Start finish!"

#========================================================================
#                    Start
#========================================================================

Command /start:
    description: Starts the game
    permission: op
    trigger:
        


#========================================================================
#                    Join
#========================================================================

Command /join <string>:
    description: Join the game
    trigger:
        add {playercount::%arg-1%} 1
        if {playercount::%arg-1%} <= {maxplayers::%arg-1%}
            if {BoatType::%uuid of player%::1}
                send title "Entered the Game!" with subtitle "You selected: Standard Boat!" to player for 5 seconds
                spawn 1 boat
                make the player ride a boat

Thx
 
Status
Not open for further replies.