Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

how can i make a if statement with the amount of parts

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!
Status
Not open for further replies.

Shavow

New Member
Reputation: 0 / 0 / 0
Apr 11, 2021
7
0
1
Roblox
versuiv
1618398343891.png 1618398398971.png hi everyone, I'm trying to run a script but I'm not sure how to,
so basically this script is meant to see that the amount of parts name (something) and determining if the amount parts there are a script can run, if that doesn't make sense, I'm basically saying that I want to know how to make a part spawn depended on the amount of the same part there is.
It's like a block collecting game and the blocks respawn once there are below the amount of 3 of the same block. I hope you can help me out cause I'm really struggling here and cant find much on the internet
 

ElHomburgerGuy

If you won't let yourself fail, you won't improve
Reputation: 5 / 0 / 1
Apr 24, 2019
6,640
20
2,586
113
Anonymous in the USA
Roblox
PieroWasTaking
Well I at least know the problem, you have the script within the part so it only will detect the one part it's inside. So instead you gonna wanna call all of them like local gainPunch = game.Workspace.GainPunch and that should call all the parts named 'GainPunch'.

I also advise you use the code inserted to make it easier for a person to copy and paste the script whenever they get a chance. ;)
1618415958024.png
 

Shavow

New Member
Reputation: 0 / 0 / 0
Apr 11, 2021
7
0
1
Roblox
versuiv
Well I at least know the problem, you have the script within the part so it only will detect the one part it's inside. So instead you gonna wanna call all of them like local gainPunch = game.Workspace.GainPunch and that should call all the parts named 'GainPunch'.

I also advise you use the code inserted to make it easier for a person to copy and paste the script whenever they get a chance. ;)
View attachment 39533
thank you for your help
 
Status
Not open for further replies.