Author Topic: Event - Treasure Chest Extension  (Read 2712 times)

Event - Treasure Chest Extension
Adds extended functionality for the default treasure chest brick.

If you have Event_onChestOpen, Event_onFoundAllChests, or Script_TreasureChestVars, delete them and replace them with this mod.

Adds the following events:
Brick > collectChest [NAME] [BOOL] - Collects or uncollects the target chest from the activating client.
Brick > checkChest [NAME] - Checks whether the activating client has collected the target chest or not.
If NAME is blank then the target brick will be considered the treasure chest brick. If it's not blank then the brick name you put in will be used as the chest brick.

onChestOpen - Called when a chest is collected that the client hasn't found yet.
onCheckChestTrue - Called when checkChest is called if the client has already collected the target chest.
onCheckChestFalse - Called when checkChest is called if the client has not already collected the target chest.
onFoundAllChests - Called when someone has collected all the chests in the server.

If Event_Variables is enabled, adds the following variables:
<var:gl:numChests>
<var:cl:chestsFound>
<var:cl:chestsLeft>

Download on Bockland Glass
« Last Edit: August 01, 2019, 08:51:30 PM by jes00 »

i once again severely thank you for spending time and resources to please my requests

No problem. Coding stuff is fun. Ideas of what to code are harder.

can u post a mirror link while glass takes its sweet forgetin time




question:

so i have a build that revolves around using chests.

client connects. collects chest.



this variables saves on pickup.

client disconnects, then comes back to the server. activates a brick with



will this save the specific chest or chests they have gotten? or can they leave/join and click the same chest over and over (which is what I don't want them doing.)

thanks in advance


edit: basically each chests adds a +1 variable and i need each individual chest only clickable once even when the client disconnects. the only script that works with this is player persistence. but with player persistence it saves the player's location, so they have no way of getting back to the start and loading their variables (chests found etc...)

need to make it so a client will click the chest, save that chest, then when they leave they can load all their chests found. i don't wanna have to individually name each chest as a variable because loading them would give the server a heart attack.
« Last Edit: August 04, 2019, 02:18:57 PM by Khorde »