TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
How do I make an actor spawn with a random chance?
Pages:
1
How do I make an actor spawn with a random chance?
Incarnin
Posts: 18
August 08, 2013, 07:22:51 am
When my player collides with the point actor, the point gets destroyed and spawns an enemy actor. I want the enemy actor to have a
50/50
chance of spawning but I cant figure out how to, any help, ideas?
GeorgeN
Posts: 856
August 08, 2013, 07:34:42 am
Set "chance" to [random number between 1 and 100]
If "chance"<=50
spawn actor
where "chance" is a number attribute
letmethink
Posts: 2545
August 08, 2013, 07:35:20 am
Set (Spawn Enemy) to (pick random (0) to (1))
if <(Spawn enemy)=(1)>
create enemy...
Edit: Was beaten to it by GeorgeN
~Letmethink
Incarnin
Posts: 18
August 08, 2013, 08:00:06 am
Thanks! It works now, thanks for both of your help
Pages:
1