Adding on to that check for any duplicates or anything like that!
Indeed I have.
Even if all parts aren’t loaded in, the table will fetch whatever parts exist and simply apply the script changes to them. Once all parts are the loaded in, it will fetch them again, and simply do the same thing. That is if you put it inside the clicked function which is what I did, and yes works just fine on another place.
I’m stumped to. I hope a future update to Studio fixes the issue.
edit I’ll keep the code in there and see if it magically changes one day because that place also had an issue where spawn points where ignored and would spawn you 20-25 studs high in the air over the spawn point, but in a later update of Roblox that problem disappeared without any changes on my end.
Is your part in any folder or something like that?
No? Even then it gets Decendants which should get things within folders/models anyways. As mentioned before, this exact code has worked before with no changes.
Sorry, I got nothing then! Maybe try using a different script.
I think it has something to do with another one of your scripts because it works completely fine for me
I don’t have any other script that manipulates changing parts from my knowledge. This is the only script that changes a parts material. I’ll try removing that game.IsLoaded() screen while it waits for assets to load but it won’t make any difference as it didn’t work before I added it.
Can you try testing the script inside a plain baseplate to see if it really is another script
If you read previous replies this has already been done, thank you for having the same idea that it could be that issue. I feel like it’s simply an engine bug. This is just like a spawn point issue I had where it always forced you to spawn 20 studs in the air over the spawn point. It works in other games with pretty much the same scripts.
VIbe Gas Station is simply more beefier.
Sorry for so much “simply” lol
If you are 100% sure its a bug make sure to report it at #bug-reports:engine-bugs so other people dont experience the same issue aswell
I’m a Member, not a regular. This is why I dislike the developer forum because perfectly capable bug reporters have major issues that they cannot make transparent due to a role, but I respect the safety and stability measures for the forum itself and I’m okay with that, and accept it.
Anyways, I’ll check back when Roblox updates again but for now I’ll be building. Thank you for the help y’all.
Use this code to find the problem:
print(">>> CODE IS RUNNING")
local FlaggedMaterials = {Enum.Material.Glass, Enum.Material.Metal, Enum.Material.Ice, Enum.Material.DiamondPlate, Enum.Material.SmoothPlastic}
local PartsToChange = workspace:GetDescendants()
script.Parent.MouseButton1Click:Connect(function()
print(">>> CLICKED")
for i, Part in ipairs(PartsToChange) do --Use ipairs for arrays btw
if Part:IsA("BasePart") or Part:IsA("Part") then
if table.find(FlaggedMaterials, Part.Material) then
Part.Material = Enum.Material.Plastic
print("Material Changed")
end
end
end
script.Parent.BackgroundColor3 = Color3.fromRGB(0,255,0)
script.Parent.Text = "Rejoin to disable."
end)
If “>>> CODE IS RUNNING” doesn’t print, check the parent of the script. If “>>> CLICKED” doesn’t print after you click, look into your UI.