Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing properties through variables?

Asked by 7 years ago

When I run this code it displays no errors on the input but the part still hasn't change into Grass

part = game.Workspace.Part
prop = part.Material

prop = ("Grass")

1
Variables aren't pointers or references, you're just changing the value of the variable and not the property. 1waffle1 2908 — 7y
0
I see what you mean by just changing the value of the variable now I replaced the 4th line with part.prop = "Grass" but the output said "prop is not a valid member of Part" ambu123 5 — 7y
0
parts don't have a property called "prop". There's a Material property, did you mean `part.Material = "Grass"` BlueTaslem 18071 — 7y
0
I tried to make "prop" contain the Part's property then just change it part.prop = "Grass" is there a way like that? ambu123 5 — 7y

Answer this question