يسوي عواميد فلابي بير ب اماكن فتحه عشوائيه ويتحرك
Script.luau
55 lines
local FLOOR_Y = 0
local CEILING_Y = 50
local GAP_SIZE = 14
local Run = game:GetService("RunService")
local function createPipePair(x)
local gabcanter = math.random(FLOOR_Y + GAP_SIZE,CEILING_Y - GAP_SIZE)
local gapBottom = gabcanter - (GAP_SIZE) / 2
local gaptop = gabcanter + (GAP_SIZE) / 2
local hightBottom = gapBottom - FLOOR_Y
local highttop = CEILING_Y - gaptop
local CanterBottom = (FLOOR_Y + gapBottom) / 2
local centerTop = (gaptop + CEILING_Y) / 2
local partBottom = Instance.new("Part")
partBottom.Size = Vector3.new(4,hightBottom,4)
partBottom.Position = Vector3.new(x,CanterBottom,0)
partBottom.Parent = workspace.Folder
partBottom.Anchored = true
local partTop = Instance.new("Part")
partTop.Size = Vector3.new(4,highttop,4)
partTop.Position = Vector3.new(x,centerTop,0)
partTop.Parent = workspace.Folder
partTop.Anchored = true
local Runservice
Runservice = Run.Heartbeat:Connect(function(dt)
partTop.Position = partTop.Position + Vector3.new(20 * dt,0,0)
partBottom.Position = partBottom.Position + Vector3.new(20 * dt,0,0)
end)
task.delay(5,function()
Runservice:Disconnect()
partTop:Destroy()
partBottom:Destroy()
end)
end
while task.wait(1) do
createPipePair(10)
end
ban