How to use script to cover everything in snow

Hi! Christmas is almost here and I want to add a layer of snow on top of everything in my map. But doing so manually would take FOREVER! Is there a way to do it using a script? Decals might not work because I have unions (barricades to be precise). Please help! Thanks!

3 Likes

i see i guess you can do is clone everysingle part and make its position on top and squish it then yea snow

2 Likes

lol the best explanation ever 10/10

ikr lol sorry idk how to explain lol

oooh yes. but, the only thing is it won’t work with unions :frowning: how do I do it?

1 Like

idk how to separate them into parts via script can u give me example?

i see idk if there is a function that separates cause there used to be one hold on ill find an article

um sry im rlly dumb with squashing parts with script i was like “oh yeah thats easy” until i start writing a script sry can someone help? It would be so easy with the tool but i can’t just change the size i need to move the position too

oh to squish em just set there y size to a 0.1 or 0.001 and do this before setting position or it would glitch

You can add snow on the roofs of something with a region3, just make one which covers all of the roofs, store everything which comes in the region in a table and loop through the table with a for loop, add your snow model 1 stud above every part w/ its orientation.

yes but, if the position is the same, it just stay in the middle of the part, not on top ;-;

yes i know i am making the script please hold on

thank you so much bro ur the best :slight_smile:

local snow_holder = workspace:FindPartsInRegion3(regionName)

for _, xyz in pairs(snow_holder) do
     if xyz:IsA("Part") then
      local snowModel = snowmodels path:Clone()
      sbowModel.Position = xyz.Position + 1/0.5 studs

   end
end

Something like this should work

ok lemme try ‎‎‎ ‎‎‎ ‎‎‎ ‎‎‎ ‎‎‎ ‎‎‎ ‎‎‎

I haven’t given you the entire script, you have to make the region yourself, because understanding and learning something is far greater than copy pasting, Give a man a fish, he eats for a day. Teach him how to fish and he eats for life.

1 Like
for i,v in pairs(game.Workspace:GetChildren()) do
	if v:IsA("Part") and v.Name ~= "Baseplate" then
			local snow = v:Clone()
			snow.Parent = v
			snow.Size = snow.Size-Vector3.new(0,snow.Size.Y-0.1,0)
			snow.Anchored = true
			snow.BrickColor = BrickColor.new("White")
			snow.Material = "Sand"
			snow.Position = v.Position + Vector3.new(0,(v.Size.Y/2)+0.05,0)
	end
end

this works for parts doe for unions glitches start to happen but it does work

1 Like

thanks! only problem is it doesn’t work for unions :frowning:

yes i know sadly because unions scale mechanic work like models and there is no possible way to separate a union if there was i couldve have made it compatible with unions

Don’t you think that doubling the amount of parts in your game can impact the game’s performance?