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

How do you use arguments/variables in a location?

Asked by 10 years ago

I am trying to make a plugin but it gives an error that says: "Mat" is not a valid Enum material. I have tried parentheses and quotations, parentheses, and quotations. This is the code

01local plugin = PluginManager():CreatePlugin()
02local toolbar = plugin:CreateToolbar("Filling tools")
03local button = toolbar:CreateButton(
04    "",
05    "Flood fill",
06    "Potato.png"
07    )
08 
09Fillblock=""
10active = 0
11--____________________________________________
12 
13_G.Changeblock = function(Mat)
14    Fillblock = Enum.Material.Mat
15end
View all 31 lines...

NOTE: Some functions are not implemented like _G.Help()

0
function x(y) print(Enum.Material[y]) end x('Grass') -->Enum.Material.Grass. ImageLabel 1541 — 10y

1 answer

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

You have to use the [] operator!

1_G.Changeblock = function(Mat)
2    Fillblock = Enum.Material[Mat]
3end
0
I could of thought of that XD dang it! EzraNehemiah_TF2 3552 — 10y
Ad

Answer this question