-
What I you want to achieve? I’m working on a tower of hell game I’m just making a rough outline set. I want to get a random Item from the folder add it to my table and spawn it in
-
What is the issue?
-- Thanks in advance
What I you want to achieve? I’m working on a tower of hell game I’m just making a rough outline set. I want to get a random Item from the folder add it to my table and spawn it in
What is the issue?
-- Thanks in advance
table
is already a library, maybe rename the children table to something else so it doesn’t get overriden.
I’ll try that.Thanks a lot.
Could you show the script with the line number?
If you are looking to get 1 item, consider using this
local item
do
local children = something:GetChildren()
item = children[math.random(1,#children)]
end
What you did wrong here is that
local math = 1+ 1+ 1+1+ 1+1
math = math.sin(math) --> error, you redefined math!
You are overshadowing the library. This means that the original table
global was overwritten and is now a simple variable in that scope. Do not use this practice and use alternate variable names which are more descriptive.