I scripted this in like 2 minutes, basically, I made a model in my game so whenever a player steps on it, it would fall down and disappear then after the cooldown it will reappear, basically like an obstacle.
It says in the output: Y cannot be assigned to (line 11)
local cooldown = 4
for _,v in pairs(script.Parent:GetChildren()) do
if v.Name == 'Script' then return end
if v:IsA("BasePart") then
v.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildWhichIsA("Humanoid") then
wait(1)
spawn(function()
for i = 0, 20, 1 do
v.Position.Y = v.Position.Y - i
wait()
end
end)
v.CanCollide = false
for i = 0, 1, 0.1 do
v.Transparency = v.Transparency + i
wait()
end
wait(cooldown)
spawn(function()
for i = 0, 20, 1 do
v.Position.Y = v.Position.Y + i
wait()
end
end)
v.CanCollide = true
for i = 0, 1, 0.1 do
v.Transparency = v.Transparency + i
wait()
end
end
end)
end
end

1 comment
X, Y, Z are read-only, you cannot edit them.