So I wanted to do a plugin that when you touch it, it will change into another building/object. Also, if you upgrade the said building, the clicking fun function would be gone. How do I code it?
Idk how fun attribute works... I'm a bit confused
[ANSWERED] How to code using fun?
Moderator: Plugin Moderators
- TheFennekin
- Neighborhood fox
- Reactions:
- Posts: 2728
- Joined: 24 Aug 2017, 11:17
- Location: Wandering around
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
[ANSWERED] How to code using fun?
Last edited by TheFennekin on 25 Mar 2022, 02:32, edited 1 time in total.
- TheFennekin
- Neighborhood fox
- Reactions:
- Posts: 2728
- Joined: 24 Aug 2017, 11:17
- Location: Wandering around
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: How to code using fun?
Addition, let's say I only wanted to make the click function to be used only when it's night. Is that possible?
- LightBlue
- TheoTown Veteran in Pension
- Reactions:
- Posts: 946
- Joined: 13 Feb 2022, 12:34
- Location: Earth
- Plugins: Showcase Store
- Version: Beta
- Contact:
-
Platform
Re: How to code using fun?
Idk...
- TheFennekin
- Neighborhood fox
- Reactions:
- Posts: 2728
- Joined: 24 Aug 2017, 11:17
- Location: Wandering around
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: How to code using fun?
Hi, fun is not able to detect state of the day. For that you are encouraged to use Lua.
However, the other things can be done using fun and would probably look like that:
However, the other things can be done using fun and would probably look like that:
Code: Select all Reset
[ { // ... "on click fun":[ { "condition":{"type":"upgrade","id":"id of the upgrade","invert":true}, "actions":[ {"type":"remove"}, {"type":"build","id":"id of another building"} ] } ] } ]
JSON checker
- TheFennekin
- Neighborhood fox
- Reactions:
- Posts: 2728
- Joined: 24 Aug 2017, 11:17
- Location: Wandering around
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: How to code using fun?
Oh I see, thank you so much Lobby!