So I am making a map and I need something that can push objects out of a tube or something that then retracts its piston so it can push them again when the items re-spawn. Thanks in advance!
Bumb! I really need help with this if anybody knows.
I don’t know myself but there are some utube channels that may help. Pokefile taught me h2a scripting and halofollower forgelabs all those may be able to show you. Otherwise good luck
What you want is to make a cannon right? If so you will need a starting device which can be done one of two ways. A panel to interact with or something that can explode. If you plan to use a panel use the command ‘on interaction’ and either send message or power state. The other option is something like a fusion coil since there is an option that upon destruction it will activate. I would recommend send message because power state would need to be reset back to the other state.
Then the object you plan to use to push the item will need to have fixed physics, since it will just fall with normal and if you use phased it will just go through whatever object you are trying to launch, and the command ‘message receive’ or ‘on power state’ depending on which one you choose for the interaction object. Then find the command prompt that will cause it to move and set that to move how ever far you need and set the travel time to a second or less but not zero.
Also the pushing object will need a second script that returns it to the original position which will need to be activated by another button or explosive device. Just make sure that both run on different channels.
I haven’t done this myself so this is just speculation. I’ve only made moving doors so far so if it doesn’t work message me and I will see if I can figure out how to make it work when I get up in the morning.
Here are the settings you’d want. I’m doing this while half-asleep so there may be the odd error
Terminal settings
Script 1
Channel: Alpha (Just using A. Use whatever ypu want, obviously)
Action when triggered: Change state
Change state to: On
Script 2
Action when triggered: Change state
Channel: alpha
Change state to: off
Block settings- either for one block or grouped items
Script 1
Condition: If Condition changed
Channel: alpha
State: On
Action: Move offset
-X (change these co-ordinates depending on how the object will move. You’ll have to experiment here)
-Y
-Z
Time: however long you want it to take
Script 2
Condition: if condition changed
Channel: alpha
State: off
Action: reset to start position (this will close the door or whatever when you press the terminal again)
Time: presumably the same as how long it took to open.
That’s the general gist of it. I’m writing this at 6am, otherwise I would have screenshotted my settings for my doors. Regardless, it should be enough to get you started - you should be able to adapt what I just wrote easily enough. Honestly, the best advice with scripting is to mess around with it and experiment, get uses to it.