Advertisement
c00lkiddv2016

ROBLOX Optical Illusion

May 17th, 2016
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2. gs = 25
  3.  
  4. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  5. part.Parent = parent
  6. part.formFactor = form
  7. part.CanCollide = collide
  8. part.Transparency = tran
  9. part.Reflectance = ref
  10. part.Size = Vector3.new(x,y,z)
  11. part.BrickColor = BrickColor.new(color)
  12. part.TopSurface = 0
  13. part.BottomSurface = 0
  14. part.Anchored = anchor
  15. part.Locked = true
  16. part:BreakJoints()
  17. end
  18.  
  19. function mesh(mesh, parent, x, y, z, type)
  20. mesh.Parent = parent
  21. mesh.Scale = Vector3.new(x, y, z)
  22. mesh.MeshType = type
  23. end
  24.  
  25. function grid(xp,zp,bp,mod)
  26. local p = Instance.new("Part")
  27. prop(p,mod,true,0,0,gs,0.1,gs,"Really black",true,"Custom")
  28. p.CFrame = CFrame.new(bp) * CFrame.new(xp,workspace.Base.Size.Y/2,zp)
  29. Instance.new("BlockMesh",p).Scale = Vector3.new(1,0.08,1)
  30. for i=0, math.pi/2, math.pi/2 do
  31. local o = Instance.new("Part")
  32. prop(o,mod,true,0,0,gs/8,0.1,gs,"Dark grey",true,"Custom")
  33. o.CFrame = p.CFrame * CFrame.Angles(0,i,0)
  34. Instance.new("BlockMesh",o).Scale = Vector3.new(1,0.09,1)
  35. end
  36. local c = Instance.new("Part")
  37. prop(c,mod,true,0,0,gs/3.5,0.1,gs/3.5,"Institutional white",true,"Custom")
  38. c.CFrame = p.CFrame
  39. Instance.new("CylinderMesh",c).Scale = Vector3.new(1,0.1,1)
  40. end
  41.  
  42. me.Chatted:connect(function(msg)
  43. if string.sub(msg,1,4) == "grid" then
  44. local model = Instance.new("Model",workspace)
  45. model.Name = "lol"
  46. local basepos = workspace.Base.Position
  47. local x = -workspace.Base.Size.Z/4
  48. local z = -workspace.Base.Size.Z/4
  49. repeat
  50. grid(x,z,basepos,model)
  51. x = x + gs
  52. if x > workspace.Base.Size.X/4 then
  53. x = -workspace.Base.Size.X/4
  54. z = z + gs
  55. end
  56. wait()
  57. until z > workspace.Base.Size.Z/4
  58. elseif string.sub(msg,1,3) == "gs/" then
  59. gs = string.sub(msg,4)
  60. elseif string.sub(msg,1,8) == "remogrid" then
  61. for _,v in pairs(workspace:children()) do
  62. if v.Name == "lol" then
  63. v:remove()
  64. end
  65. end
  66. end
  67. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement