Categories > Coding > Lua >
Unable to cast value to Object?
Posted
What i'm doing wrong?
If i just print GetChildren():
https://i.imgur.com/gZqCSMX.png
But then i try to do: And i got error. Why?(Path Folder contain Frames)
https://i.imgur.com/cEGfWAN.png
local Folder = PathToFolder:GetChildren()
for i, value in ipairs(Folder ) do
local args = {
[1] = {
[1] = value.Name
}
}
game:GetService("ReplicatedStorage").craft:InvokeServer(unpack(args))
end
Replied
The format almost made me cry, I've rewritten your code, let me know if it works.
local Folder = workspace.Folder:GetChildren()
local Craft = game:GetService("ReplicatedStorage").craft
for __,v in next, Folder do
if v:IsA("Frame") then
local args = {
[1] = {
[1] = v.Name
}
}
Craft:InvokeServer(unpack(args))
end
end
Cancel
Post
https://media.discordapp.net/attachments/1134643100715855893/1138795549244539011/SiggyOnGod.png
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post