this code will go into a block that falls when a player steps on it, I also want the transparency to go down after it unanchores.
repeat part.Transparency - 20
until part.Transparency = 0
and this code makes it fall, but when I add the other code it doesn't work.
local part = script.Parent
local function onPartTouched(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
wait(0.1) -- I can adjust this
part.Anchored = false
--repeat part.Transparency - 20
--until part.Transparency = 0
end
end
part.Touched:Connect(onPartTouched)

2 comments
your code only works once a player is on the block, and once they get off of it it's back to normal
I edited it