local Storage = game:GetService("ReplicatedStorage")
local Stands = Storage:WaitForChild("Stands")
local Stand = Stands:WaitForChild("Stand1")
local Stand2 = Stands:WaitForChild("Stand2")
local Stand3 = Stands:WaitForChild("Stand3")
WaitFirstChild is not a valid member of ReplicatedStorage "ReplicatedStorage"
Dang new problem arrived ;-;
Did you put the Stands folder in Replicated Storage?
My bad, I meant “WaitForChild” I’ve edited the original reply.
WaitFORChild bruuuuuh, Does WaitFirstChild even exist?
ccccharacter30
Yes, why diddn’t I see this lol.
Also store all the stands in a folder in Replicated Storage an use an in pairs or in next loop to iterate over it
its working nowwwwwwwwwwwwwwwwwwwwwww
what do you mean, do you mean
for v, i in pairs
i dont know how to use this
Do you want me to explain it in short?
yes please , i feel like a total noob
for i,v in pairs(Stands:GetChildren()) do
-- // v will get everything in that stands folder
-- // if you want to check a name in the folder you do
if v.Name == "Stand1" then
-- // Whatever code here
end
-- // if you want to touch a part in a pairs you can do
v.TouchPart.Touched:Connect(function()
-- // after touched whatever you put here will be whatever u want
end)
end
There is soo many more stuff you can do with pairs which will save lots of time while programming.
i havn’t added the loop yet but this video shows that it works
its low quality since high quality was too big for roblox so i cut the quality
So, I v loops are loops which are used to iterate over tables, Assuming you know what tables are, Im gonna give you a short example. I’ll just show you how to color a house using this method.
local ourAmazingTable = Game.Workspace.HouseModel:GetChildren() --get children always returns a table of the object it is being performed on.
for _, v in pairs(ourAmazingTable) do -- we put our table in parenthesis
v.BrickColor = BrickColor.Random()
end)
Now this might be confusing, but it is quite simple. i stands for index, but you can just leave it as _ and v stands for variable. As v is a variable, it can be anything. here v basically represents all of the things in the table, and our table only has parts.
Thats _, v or i, v loops in a nutshell
I mean if it works you can learn pairs later on in the development if its to confusing for you right now.
so i could just replace this mess with the i, v in pairs loop?
if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
local prevStand = workspace:FindFirstChild(player.Name.." Stand")
local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
prevStand:addTo(Debris)
prev:addTo(Debris)
S1.Disabled = true
S2.Disabled = true
S3.Disabled = true
Stand:Clone()
Stand.Parent = Backpack
S1.Disabled = false
else
Stand:Clone()
warn("Check2")
Stand.Parent = Backpack
warn("Check2.0")
S1.Disabled = false
Basically yes.
Char Max REEEEEEE (Ignore lol)
Yeah, i, v loops are really handy
i have to get offline rn, tysm for the help yall, i will be back and maybe post about my progress
Mark a solution before you leave