Advertisement
AkrD1337

Platforma

May 2nd, 2024
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local mouse = player:GetMouse()
  3.  
  4. local function clearAllParts()
  5. for _,object in pairs(workspace:GetChildren()) do
  6. if object.Name=="PLATFORM" then
  7. object:Destroy()
  8. end
  9. end
  10. end
  11.  
  12. local function createPart()
  13. local part = Instance.new("Part",workspace)
  14. part.Name = "PLATFORM"
  15.  
  16. part.Size = Vector3.new(15,0.3,15)
  17. part.Transparency = 0.4
  18.  
  19. part.Anchored = true
  20. part.CanCollide = true
  21.  
  22. part.Material = Enum.Material.SmoothPlastic
  23. part.TopSurface = Enum.SurfaceType.Smooth
  24. part.BottomSurface = Enum.SurfaceType.Smooth
  25.  
  26. part.Position = player.Character.Humanoid.RootPart.Position - Vector3.new(0,2.5,0)
  27. end
  28.  
  29. local function createParte()
  30. local part = Instance.new("Part",workspace)
  31. part.Name = "PLATFORM"
  32.  
  33. part.Size = Vector3.new(60,0.3,60)
  34. part.Transparency = 0.4
  35.  
  36. part.Anchored = true
  37. part.CanCollide = true
  38.  
  39. part.Material = Enum.Material.SmoothPlastic
  40. part.TopSurface = Enum.SurfaceType.Smooth
  41. part.BottomSurface = Enum.SurfaceType.Smooth
  42.  
  43. part.Position = player.Character.Humanoid.RootPart.Position - Vector3.new(0,3,0)
  44. end
  45.  
  46. game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(aa)
  47. if aa == "x" then
  48. clearAllParts()
  49. createPart()
  50. end
  51. end)
  52.  
  53. game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(aa)
  54. if aa == "v" then
  55. clearAllParts()
  56. end
  57. end)
  58.  
  59. game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(aa)
  60. if aa == "b" then
  61. clearAllParts()
  62. createParte()
  63. end
  64. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement