I'm currently attempting to create a part when you touch it, it spawns in a model from a folder within workspace. I've got most of it down, although my issue is the value of " i, v " not changing after the script runs...
Here is the code...
local used = false
local stage = script.Parent
function OnTouched(part)
local ObbyTable = game.Workspace.stages:GetChildren()
for i, v in pairs(ObbyTable) do
if used == false then
local newstage = v:Clone()
newstage.Parent = workspace.newstages
newstage.PrimaryPart = newstage.Main
newstage:SetPrimaryPartCFrame(newstage:GetPrimaryPartCFrame() * CFrame.new(0,0,-34))
print(i, v)
used = true
end
end
end
script.Parent.Touched:connect(OnTouched)

3 comments
I don't really know what you're trying to do nor can I really read your script but to put it in simpler terms, i in the amount of the stuffs you have in "ObbyTable" and "v" is the actual stuff inside
Could you inform us of the contents of ObbyTable?
What are you trying to achieve?