Help With Raining Candy

Hey Coldshot_Dev!

I figured out your issue below:

for i = 1,100 do
	local candy = game:GetService("ServerStorage"):WaitForChild("Candy"):Clone()
	candy.Position = Vector3.new(math.random(-120,120),100,math.random(-120,120))
	candy.Parent = workspace
end

If you look, you did not clone the candy piece before you took it and positioned it and once one piece was generated, it was missing! This code can replace your server code.

1 Like

Also, if another script is interfering as @ExcessEnergy mentioned, make the data table that remakes the part before the player joins and then set the CanColide to false, transparency to 0 and change this back once you declare the event.

1 Like

The candy seems to now all form into one, which gives you 100 if you touch it. Instead of having 100 different ones that each give you 1.

Hey Coldshot_Dev!

I will be giving my edited place file below! Hope this helps:
CandyGeneration.rbxl (22.6 KB)

Can you go deeper on what you mean?

Your edited version seems to have all the candies frozen mid-air.

Theres just 1 candy that on touch gives 100.

Use candy.Anchored = false. Or make sure that the candy is not anchored.

I need to see the rest of youre code.

The candy isn’t anchored.
image

What’s the issue here? I’m a bit confused.

Try using this code:

local candy = {}
	candy = game:GetService(¨ServerStorage¨):WaitForChild(¨Candy¨):Clone()
	candy.Parent = workspace
	candy.Position = Vector3.new(math.random(-120,120),100,math.random(-120,120))
	candy:Clone()
end

Hey Coldshot_Dev!

My bad, I accidentally welded it to the baseplate. Destroy the weld shown below:

image

Hope this helps!

How is it even welded to the baseplate in the first place?

By deleting the weld, the candies seem to immediatel dissapear.

Don’t make it not collide-able, it can’t interact with objects.

Edit: if you’re talking about run mode and you see it go through the floor

1 Like

Try using the code I provided.

Hey Coldshot_Dev!

I provided a working place file below:
CandyGeneration.rbxl (22.3 KB)

Oh right, that makes sense, I had it non collide-able because of something else.

also you don’t have to be like

hEy cOld_Shot SoMeOnE MaDE a VidEO aBout YouR cOldPlaY-LikE nAEM

Anyways, coldshot_dev if that is the problem you’re probably done now.

1 Like