Date: 2024/03/19 02:05:41 UTC-07:00
Type: Denizen 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
ah_command:
type: command
name: ah
debug: false
description: Buy and Sell player items!
usage: /ah sell (price)
tab completions:
1: sell
script:
- if <context.args.size> > 0:
- choose <context.args.get[1]>:
- case sell:
- define item <player.item_in_hand>
- define quantity <[item].quantity>
- if <[item]> == <item[air]>:
- narrate "Please hold an item to sell"
- stop
- define lore <[item].lore.if_null[]>
- define item <[item].with_flag[auction_item].with_flag[seller:<player>]>
- define item <[item].with_flag[price:<[price]>]>
- define rank <player.luckperms_primary_group.group_name>
- if <[rank]> == default:
- define duration 6h
- else if <[rank]> == syfon:
- define duration 18h
- else:
- define duration 24h
#Should I add a tax system? :thinking:
- define item <[item].with_flag[expire_after].duration[<[duration]>]>
- define seller <[item].flag[seller]>
- define price <[item].flag[price]>
- define time <[item].flag_expiration[expire_after].from_now.formatted>
- define info "<&nl><&a>Price: <&e><&l><[price]><&nl><&a>Seller: <&e><&l><[seller].name><&nl><&a>Time Left: <&e><&l><[time]>"
- adjust def:item "lore:<[lore]> <[info]>"
- flag server ah.items:->:<[item]>
- take iteminhand quantity:<[quantity]>
ah_handler:
type: world
debug: false
events:
on player clicks item_flagged:auction_item in auction_player_lists:
- define item <context.item>
- define time <[item].flag_expiration[expire_after]>
- narrate <[time].format[dd/MM/yyyy : HH:mm:SS]>