how to collect money in game

id: 750312

category: Help with Scripts

posts: 4

so im making a raise a floppa type game and im having a hard time with the money as i dont know how to have the player collect it.
i can have it clone when my character your raising is clicked but other than that i have no idea how to do the money.
any help for this is appreciated!
Hi! You can do something like this:

forever

if <touching [ coin v] ?> then
change [ money v] by (1)
end
End
In coin sprite:
when I start as a clone
repeat until <touching [Player v] ?>
Some possible animation
end
change [COINS v] by (1)
hide
play sound [Optional coin sound v] until done
delete this clone
MineTurte MineTurte loading

BrilliantStar114 wrote:

Hi! You can do something like this:

forever

if <touching [ coin v] ?> then
change [ money v] by (1)
end
End
This would be an endless loop; infinitely giving you money. Instead try this:
forever
if <touching [ coin v] ?> then
change [ money v] by (1)
stop [ this line]
end
End