So I have this small script that should turn trees white does not work, any help??
game.Players.PlayerAdded:connect(function(newplayer)
if script.SnowTree.Value == true then
for _,v in pairs(game.Workspace.Trees:GetChildren()) do
v.Leaves.BrickColor = BrickColor.White()
end
end
end)
game.Players.PlayerAdded:Connect(function(newplayer)
if script.SnowTree.Value == true then
for _,v in pairs(game.Workspace.Trees:GetChildren()) do
v.Leaves.BrickColor = BrickColor.new("White")
end
end
end)
Oh because it as mesh part you should use Color so the script should be:
game.Players.PlayerAdded:Connect(function(newplayer)
if script.SnowTree.Value == true then
for _,v in pairs(game.Workspace.Trees:GetChildren()) do
v.Leaves.Color = Color3.fromRGB(1,1,1)
end
end
end)
game.Players.PlayerAdded:Connect(function(newplayer)
if script.SnowTree.Value == true then
for _,v in pairs(game.Workspace.Trees:GetChildren()) do
v.Leaves.Color = Color3.fromRGB(1,1,1)
v.Leaves.TextureID = "rbxassetid://132155326"
end
end
end)
Just curious, is there a reason why you want to run this code whenever a player joins?
If this is client-sided, PlayerAdded wont trigger. Make sure SnowTree is true and Leaves.UsePartColor is true if it’s a union.
No its server sided, the reason I trigger it when the player joins is I needed a function to be able to use a end) because I use 1 big main script for all of my script, saves space.