Advertisement
cat568

true

Apr 9th, 2022
1,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local InputKey = "E"
  3.  
  4. local UserInputService = game:GetService("UserInputService")
  5. local twenserv = game:GetService("TweenService")
  6.  
  7. local tabl = {}
  8. local coun = 0
  9. local real = false
  10.  
  11. UserInputService.InputBegan:connect(function(UserInput)
  12.     if UserInput.UserInputType == Enum.UserInputType.Keyboard then
  13.         if UserInput.KeyCode == Enum.KeyCode[InputKey] then
  14.        
  15.            
  16. real = true
  17.         end
  18.     end
  19. end)
  20. UserInputService.InputEnded:connect(function(UserInput)
  21.     if UserInput.UserInputType == Enum.UserInputType.Keyboard then
  22.         if UserInput.KeyCode == Enum.KeyCode[InputKey] then
  23.  
  24.         real = false
  25.         end
  26.     end
  27. end)
  28. wait(1)
  29. while true do
  30.     if real == false then
  31.     local par = Instance.new("Part")
  32.     par.Size = Vector3.new(1,1,1)
  33.     par.Shape = "Ball"
  34.     par.Anchored = true
  35.     par.CanCollide = false
  36.     par.Transparency = .9
  37.         par.CFrame = Player.Character.HumanoidRootPart.CFrame
  38.        
  39.     --par.Parent = game.ReplicatedStorage
  40.     par.Name = coun
  41.     table.insert(tabl,par)
  42.         coun = coun + 1
  43.         game:GetService("RunService").Heartbeat:Wait()
  44.     else
  45.         local par = table.unpack(tabl,#tabl,#tabl)
  46.         Player.Character.HumanoidRootPart.CFrame = par.CFrame
  47.         table.remove(tabl,#tabl)
  48.         coun = coun -1
  49.         par:Destroy()
  50.         game:GetService("RunService").Heartbeat:Wait()
  51.        
  52.     end
  53.    
  54.    
  55. end
  56.  
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement