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)
'i' will be 1 because it runs only 1 times. And 'v' will not change because you just clone. Clone doesn't destroy or move.