Advertisement
Descaii

Glue cloth

Aug 9th, 2014
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. X = 1
  2. Y = 10
  3. S = 2
  4. N = S+.1
  5. local t = {}
  6. local p = Instance.new("Model",Workspace)
  7. for x = 1,X do
  8.     t[x]={}
  9.     for y = 1,Y do
  10.         local P = Instance.new("Part",Workspace)
  11.         P.Anchored = (y == 1)
  12.         P.FormFactor = "Custom"
  13.         P.Size = Vector3.new(S,S,1)
  14.         P:breakJoints()
  15.         P.CFrame = CFrame.new((X-x)*N,(Y+2-y)*N,0)
  16.         P:breakJoints()
  17.         P.Transparency = 0
  18.         ypcall(function()
  19.             local AB = t[x][y-1]
  20.             if AB and y ~= 1 then
  21.                 local W = Instance.new("Glue",P)
  22.                 W.Part1 = P
  23.                 W.Part0 = AB
  24.                 W.C0 = CFrame.new(0,-N,0)
  25.             end
  26.             local BK = t[x-1][y]
  27.             if BK and x ~= 1 then
  28.                 local W = Instance.new("Glue",P)
  29.                 W.Part1 = P
  30.                 W.Part0 = BK
  31.                 W.C0 = CFrame.new(-N,0,0)
  32.             end
  33.         end)
  34.         t[x][y]=P
  35.         if x == X and y == Y and script.ClassName == "LocalScript" then
  36.             local W = Instance.new("Weld",P)
  37.             W.Part0 = P
  38.             W.Part1 = game.Players.LocalPlayer.Character.Torso
  39.             W.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,math.rad(90))
  40.             game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  41.             game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
  42.         end
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement