Trying to get a Value from a certain child?
Asked by
6 years ago Edited 6 years ago
Problem it is going to the first land and not the one that has the players name.
I need it to pull the Value from "ColorValue" and "MaterialValue" that's inside that players land. So when I wright "= land.ColorValue.Value" its going to the first child not the one by name so I get an error saying that = ColorValue isn't there.
01 | local player = game.Players.LocalPlayer |
02 | B 2 b = require(game.ServerScriptService.Blocks.B 2 B) |
06 | setmetatable (Block, B 2 b) |
08 | function Block.new(...) |
09 | local newblock = B 2 b.new(...) |
10 | setmetatable (newblock, Block) |
12 | for _, land in pairs (workspace.Buildings:GetChildren()) do |
13 | if land.Name.Value = = player then |
14 | newblock.blockColor = land.ColorValue.Value |
15 | newblock.blockMaterial = land.MaterialValue.Value |