Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » floor 2 in mining game spawns 7x as much ores as it should
- tame_doggo
-
Scratcher
10 posts
floor 2 in mining game spawns 7x as much ores as it should
I am making a mining game and when you go to a new floor, it should spawn a few ores around the level. However, floor 2 does not. It spawns 42 ores instead of 6, and i have tried about everything but i cannot seem to fix it. I don't think i will be able to update unless it gets fixed. Could someone look into its code and see if i missed something? Thanks.
PS- i tested and the player doesn't seem to be making the “start new area” command broadcast 7 times.
PS- i tested and the player doesn't seem to be making the “start new area” command broadcast 7 times.
- Catscratcher07
-
Scratcher
1000+ posts
floor 2 in mining game spawns 7x as much ores as it should
you need to add something to stop clones from receiving the start new area broadcast
- medians
-
Scratcher
1000+ posts
floor 2 in mining game spawns 7x as much ores as it should
you need to add something to stop clones from receiving the start new area broadcastYeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
1.

Create a variable to check if it is a clone. Make sure for this sprite only is on.
2.
Add this script:

Clones will have 1 set to that variable, while the sprite itself will have 0 now.
- ded_PC
-
Scratcher
100+ posts
floor 2 in mining game spawns 7x as much ores as it should
But, change the ‘1’ to ((Clone) + (1))you need to add something to stop clones from receiving the start new area broadcastYeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
1.
Create a variable to check if it is a clone. Make sure for this sprite only is on.
2.
Add this script:
Clones will have 1 set to that variable, while the sprite itself will have 0 now.
- medians
-
Scratcher
1000+ posts
floor 2 in mining game spawns 7x as much ores as it should
Well, if you wanted to distinguish clones then maybe.But, change the ‘1’ to ((Clone) + (1))you need to add something to stop clones from receiving the start new area broadcastYeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
- ded_PC
-
Scratcher
100+ posts
floor 2 in mining game spawns 7x as much ores as it should
The problem with your code is that every time it would just set it to ‘1’ when there are ‘6’Well, if you wanted to distinguish clones then maybe.But, change the ‘1’ to ((Clone) + (1))you need to add something to stop clones from receiving the start new area broadcastYeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
Clones
- medians
-
Scratcher
1000+ posts
floor 2 in mining game spawns 7x as much ores as it should
Though, they said the issue was that every clone to not receive the broadcast, when none of them were supposed to.The problem with your code is that every time it would just set it to ‘1’ when there are ‘6’Well, if you wanted to distinguish clones then maybe.But, change the ‘1’ to ((Clone) + (1))you need to add something to stop clones from receiving the start new area broadcastYeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
Clones
- ded_PC
-
Scratcher
100+ posts
floor 2 in mining game spawns 7x as much ores as it should
Then make a floor variable too and use a costume number for it
- medians
-
Scratcher
1000+ posts
floor 2 in mining game spawns 7x as much ores as it should
Then make a floor variable too and use a costume number for it..just use this.
when I receive [broadcast v]
if <(clone?) = [0]> then
...
end
- ded_PC
-
Scratcher
100+ posts
floor 2 in mining game spawns 7x as much ores as it should
Oh, that makes sense, I'm an IDIOTThen make a floor variable too and use a costume number for it..just use this.when I receive [broadcast v]
if <(clone?) = [0]> then
...
end
- tame_doggo
-
Scratcher
10 posts
floor 2 in mining game spawns 7x as much ores as it should
Thanks for the help everyone! I fixed it and now it only spawns 6 ores!
- Discussion Forums
- » Help with Scripts
-
» floor 2 in mining game spawns 7x as much ores as it should