Page 1 of 1

我想制作一个金币系统该怎么办呢?

Posted: Tue Jan 27, 2026 7:40 pm
by Y1Y1
我是一个新手,完全没有代码基础,想制作金币形态,尝试了ai教的代码,无法使用

Re: 我想制作一个金币系统该怎么办呢?

Posted: Tue Jan 27, 2026 9:57 pm
by kerkersklave
Is this some kind of spam?

Re: 我想制作一个金币系统该怎么办呢?

Posted: Tue Jan 27, 2026 10:00 pm
by PlayfulGuy
kerkersklave wrote: Tue Jan 27, 2026 9:57 pm Is this some kind of spam?
It's hard to tell.

Translating the subject line using Google it's asking how to make a "gold coin system".
The description says they tried some AI generated code but it didn't work.

Could be a legit question about implementing something in an EOS tease, or not.

We'll need a Chinese speaker to tackle this one...

PG

Re: 我想制作一个金币系统该怎么办呢?

Posted: Wed Jan 28, 2026 10:17 am
by StellaRack
I'll bite. I don't speak Chinese. So I will leave in English

To make a coin system there is 3 key bits of code you need

Setup
Under options -> Init Script
You would want to add this
Start coins at 0. Will reset each time you load the tease

Code: Select all

var coins = 0;
To give coins
add an "Eval" action
Note that the number is how much to add. It could be any number

Code: Select all

coins = coins + 1
Check for coins
To react to how many coins you have add a "If" action
This will do the "then" actions only if you have 10+ coins
It will do the "else" actions if have 9 or less coins

Code: Select all

coins >= 10
Show how many coins you have
In a "Say" action
Press the "<>" button
Put in "coins"
This will be replaced with the number of coins

In a "Choice" action
at the bottom if you tick "Visible"
You can show a button only if you have coins
EG only show if you have 3+ coins

Code: Select all

coins >= 3
Also
> < >= <= all work.
So you can check you have less then a number of coins if needed

I have made a quick demo project with a coin system added
coin-demo-2026-01-28.zip
(597 Bytes) Downloaded 49 times