I made this Obby where there are platforms that unachor themselves if the humanoid touches it using tags but i dont know how the heck i get the cframe back to its original Position neither does Chatgpt anyway heres my code:
local CollectionServ = game:GetService("CollectionService")
local FallPartsTag = CollectionServ:GetTagged("Fall")
local FallParts = game.Workspace.FallingStuff:WaitForChild("Part")
for i, FallPart in pairs(FallPartsTag) do
local IsTouched = false
local Destroy = false
local PartPos = FallPart.CFrame
local function OrgState()
FallPart.Color = Color3.fromRGB(163, 162, 165)
FallPart.Anchored = true
FallPart.CFrame = PartPos
end
FallPart.Touched:Connect(function(plr)
local Humanoid = plr.Parent:FindFirstChild("Humanoid")
if Humanoid and not Destroy and not IsTouched then
IsTouched = true
Destroy = true
task.wait()
FallPart.Color = Color3.fromRGB(255, 0, 4)
FallPart.Anchored = false
task.spawn(function()
task.wait(1.4)
FallPart.Transparency = 1
end)
task.wait(2)
OrgState()
end
end)
end
** You are now Level 1! **