Date: 2023/04/02 16:31:29 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
fort_pic:
type: item
material: stone_pickaxe
display name: Pickaxe
fort_pic_handler:
type: world
debug: false
events:
on player animates ARM_SWING with:fort_pic flagged:fort.pic.block_target:
- define block <player.flag[fort.pic.block_target]>
- flag player fort.pic.block_target:<[block]> duration:3t
#- if <[block].flag[health]> == -1:
#- determine passively cancelled
- blockcrack <[block]> progress:0 players:<server.online_players>
- ratelimit <player> 1t
on player clicks block type:!air:
- stop if:<player.world.name.equals[fortnite_map].not>
- determine passively cancelled
- if <player.item_in_hand.script.name||null> == fort_pic:
- define block <context.location>
- flag player fort.pic.block_target:<[block]> duration:1t
#flag the block health if it hasn't been set yet
- if !<[block].has_flag[health]>:
- define mat <[block].material.name>
- define type <proc[get_material_type].context[<[mat]>]>
#if it's not in the list of valid materials to return either wood, brick, or metal
- if <[type]> == null:
- define hp -1
- else:
- define hp <script[nimnite_config].data_key[materials.<[type]>.hp]>
- flag <[block]> health:<[hp]>
#infinite durability
on fort_pic takes damage:
- determine cancelled
on player drops fort_pic:
- determine cancelled
on player clicks fort_pic in inventory:
- determine cancelled
#based on the material inputted, it returns either wood, brick, or metal
get_material_type:
type: procedure
debug: false
definitions: actual_material
script:
- foreach <list[wood|brick|metal]> as:type:
- if <script[nimnite_config].data_key[materials.<[type]>.valid_materials].contains[<[actual_material]>]>:
- define material_type <[type]>
- foreach stop
- define material_type null if:!<[material_type].exists>
- determine <[material_type]>