Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local InputKey = "E"
- local UserInputService = game:GetService("UserInputService")
- local twenserv = game:GetService("TweenService")
- local tabl = {}
- local coun = 0
- local real = false
- UserInputService.InputBegan:connect(function(UserInput)
- if UserInput.UserInputType == Enum.UserInputType.Keyboard then
- if UserInput.KeyCode == Enum.KeyCode[InputKey] then
- real = true
- end
- end
- end)
- UserInputService.InputEnded:connect(function(UserInput)
- if UserInput.UserInputType == Enum.UserInputType.Keyboard then
- if UserInput.KeyCode == Enum.KeyCode[InputKey] then
- real = false
- end
- end
- end)
- wait(1)
- while true do
- if real == false then
- local par = Instance.new("Part")
- par.Size = Vector3.new(1,1,1)
- par.Shape = "Ball"
- par.Anchored = true
- par.CanCollide = false
- par.Transparency = .9
- par.CFrame = Player.Character.HumanoidRootPart.CFrame
- --par.Parent = game.ReplicatedStorage
- par.Name = coun
- table.insert(tabl,par)
- coun = coun + 1
- game:GetService("RunService").Heartbeat:Wait()
- else
- local par = table.unpack(tabl,#tabl,#tabl)
- Player.Character.HumanoidRootPart.CFrame = par.CFrame
- table.remove(tabl,#tabl)
- coun = coun -1
- par:Destroy()
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement