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

Apparently this table Nil?

Asked by 6 years ago

v = game.Part x = v.Name

{
           [tostring(x)] = Workspace.Monsters["A1-A2"][tostring(x)]
}

I need it to become a table..

0
mhm, what is x? theking48989987 2147 — 6y
0
can you at least have well named variables or full scripts? theking48989987 2147 — 6y
0
x = game.Part.Name... Try workspace instead of game? Other than that, there isn't much we can do. There is very minimal information. EzraNehemiah_TF2 3552 — 6y
0
What is this. greatneil80 2647 — 6y
0
use game.Workspace.Part.Name, not game.Part.Name fanofpixels 718 — 6y

1 answer

Log in to vote
-1
Answered by
atawok 33
6 years ago

Assuming you have the part in workspace, you can use either of these to make a reference to it:

local v = workspace.Part
-- OR
local v = game.Workspace.Part

And no need to use the tostring() function on x, as it is already associated with a string(.Name)

local v = workspace.Part
local x = v.Name

local tab = {
    [x] = workspace.Monsters["A1-A2"][x]
}
Ad

Answer this question