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
Y is a read only value. To change the Y value you would add or subtract a vector three. For example, lets say I want to move a block a certain amount of studs down.
local i = 4 function move(object) object.Position = object.Position - Vector3.new(0,i,0)