Advertisement
dahpiglz

Pillars

Oct 25th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local mouse = player:GetMouse()
  3.  
  4. local m = Instance.new("Model")
  5. m.Parent = game.Workspace
  6. m.Name = ("Pillars")
  7.  
  8. function onKeyPress(inputObject, gameProcessedEvent)
  9. local key = inputObject.KeyCode
  10. if key == Enum.KeyCode.R then
  11. local p = Instance.new("Part")
  12. p.Size = Vector3.new(10, 0.05, 10)
  13. p.Parent = game.Workspace.Pillars
  14. p.Anchored = true
  15. p.CFrame = mouse.Hit
  16. p.Orientation = Vector3.new(0, p.Orientation.Y, 0)
  17. p.TopSurface = ("Smooth")
  18. p.BottomSurface = ("Smooth")
  19. p.Reflectance = (0.2)
  20. local v = Instance.new("NumberValue")
  21. v.Parent = p
  22. v.Name = ("MaxHeight")
  23. v.Value = (math.random(250,600))
  24. end
  25. end
  26.  
  27. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
  28.  
  29. while true do
  30. wait(0.01)
  31. for i,v in pairs(m:GetChildren()) do
  32. if v.ClassName == ("Part") then
  33. if v.Size.Y <= (v.MaxHeight.Value) then
  34. v.CanCollide = false
  35. v.Size = v.Size + Vector3.new(0.02, 7.5, 0.02)
  36. v.CanCollide = true
  37. end
  38. end
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement