- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Marriage Script


By Gershon12
Created: 2017/05/02 17:18:09 UTC-07:00 (7 years and 236 days ago)
Edited: 2017/05/02 17:18:09 UTC-07:00 (7 years and 236 days ago)
Likes: 2

Staff pick as of: 2017/05/02 20:16:38 UTC-07:00 (7 years and 236 days ago)
Denizen Version: Denizen 101
Script Version: 1
Description:

This script allows you to marry other players in-game.

Commands:
/marry (name)
/marry info - Your info
/marry info (player) - Lookup a players info
/marry divorce - Divorce a player
/marry tp - Teleport to a player you are married to


Download script | View raw script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
13100

marry_command_handler: 
  type: command 
  debug: false 
  name: marry 
  description: Marriage
  usage: /marry
  script: 
    - choose <context.args.get[1]||null>: 
      - case help: 
        - inject locally path:help
      - case accept: 
        - inject locally path:accept
      - case deny: 
        - inject locally path:deny
      - case decline: 
        - inject locally path:deny
      - case divorce: 
        - inject locally path:divorce
      - case info: 
        - inject locally path:info
      - case tp: 
        - inject locally path:tp 
      - default: 
        - inject locally path:player 
  help: 
    - narrate "<&l><&a>------------- Marriage Help -------------"
    - narrate "<&a>/marry (player) <&r><&7> Request a player to marry you"
    - narrate "<&a>/marry divorce <&r><&7> Divorce the person you are married to"
    - narrate "<&a>/marry tp <&r><&7> Teleport to your partner"
    - narrate "<&a>/marry info <&r><&7> Information about your marriage"
    - narrate "<&a>/marry info (player)<&r><&7> Marriage information about another player"
    - narrate "<&l><&a>-----------------------------------------"
  player:
    - if <player.has_flag[partner]> { 
      - narrate "<&c>You are already married!"
      - queue clear 
      }
    - define target <server.match_player[<context.args.get[1]||null>]||null> 
    - if <def[target]> == null { 
      - narrate "<&c>That person is not online!"
      - queue clear 
      }
    - if <def[target].has_flag[partner]> { 
      - narrate "<&c>That person is already married!"
      - queue clear 
      }
    - flag <def[target]> marriage_request:<player.name> duration:1m 
    - define playername <def[target].name||null>
    - narrate "<&a>You have requested <def[playername]> to marry you!"
    - narrate "<&a><player.name> has requested to marry you!" targets:<def[target]>
    - narrate "<&a>Use <&e>/marry accept <&a>or <&c>/marry deny" targets:<def[target]>
  accept:
    - if <player.has_flag[marriage_request].not> { 
      - narrate "<&c>You do not have any marriage requests!"
      - queue clear 
      } 
    - define target <player.flag[marriage_request]||null> 
    - if <def[target]> == null { 
      - narrate "<&c>That person is not online!"
      - queue clear 
      }
    - if <def[target].has_flag[partner]> { 
      - narrate "<&c>That person is already married!"
      - queue clear 
      }
    - flag p@<def[target]> date_married:<util.date>
    - flag player date_married:<util.date>
    - flag p@<def[target]> partner:<player.name>
    - flag player partner:<def[target]>
    - flag p@<def[target]> marriage_points:0
    - flag player marriage_points:0
    - narrate "<&a>You are now married to <def[target]>."
    - narrate "<&a>You are now married to <player.name>." targets:p@<def[target]>
    - execute as_server "broadcast <&a><&l><player.name> and <def[target]> are now married!"
  deny:
    - if <player.has_flag[marriage_request].not> { 
      - narrate <&c>You do not have any marriage requests!"
      - queue clear 
      } 
    - define target <player.flag[marriage_request]||null> 
    - if <def[target]> == null { 
      - narrate "<&c>That person is not online!"
      - queue clear 
      }
    - narrate "<&a>You have declined the marriage request from <def[target]>."
    - narrate <&a><player.name> has declined your marriage request." targets:p@<def[target]>
  divorce:
    - if <player.has_flag[partner].not> { 
      - narrate "<&c>You are not married!"
      - queue clear 
      } 
    - define target <player.flag[partner]||null> 
    - if <def[target]> == null { 
      - narrate "<&c>That person is not online!"
      - queue clear 
      }
    - flag p@<def[target]> partner:!
    - flag player partner:!
    - flag p@<def[target]> date_married:!
    - flag player date_married:!
    - flag p@<def[target]> marriage_points:!
    - flag player marriage_points:!
    - narrate "<&a>You have divorced from <def[target]>."
    - narrate "<&a><player.name> has divorced from you!" targets:p@<def[target]>
  info: 
    - narrate "<&l><&a>------------- Marriage Info -------------"
    - if <context.args.get[2]||null> != null {
      - define target <server.match_offline_player[<context.args.get[2]||null>]||null> 
      - narrate "<&a><context.args.get[2]> is married to:<&e> <def[target].flag[partner]||no one :(>"
      - if <def[target].has_flag[date_married]> { 
        - narrate "<&a>Date married:<&e> <def[target].flag[date_married]>"
        - narrate "<&a>Marriage points:<&e> <def[target].flag[marriage_points]>"
        }
      - narrate "<&l><&a>-----------------------------------------"
      - queue clear 
      } 
    - narrate "<&a>You are married to:<&e> <player.flag[partner]||no one :(>"
    - if <player.has_flag[date_married]> { 
      - narrate "<&a>Date married:<&e> <player.flag[date_married]>"
      - narrate "<&a>Marriage points:<&e> <player.flag[marriage_points]>"
      }
    - narrate "<&l><&a>-----------------------------------------"
  tp:
    - if <player.has_flag[partner].not> { 
      - narrate "<&c>You are not married!"
      - queue clear 
      }
    - narrate "<&a>You have teleport to <player.flag[partner]>."
    - execute as_op "tp <player.flag[partner]>"
    - narrate "<&a><player.name> has teleported to you!" targets:p@<player.flag[partner]>





View History