Advertisement
GustavoDestroyer

Criar chão [E] [F] v2.0

Nov 16th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local UIS = game:GetService("UserInputService")
  3.  
  4. Debounce = false
  5. local Part = Instance.new("Part")
  6. Part.Name = "Voador"
  7. Part.Size = Vector3.new(10, 1, 10)
  8. Part.Anchored = true
  9. Part.Transparency = 1
  10. Part.Parent = game.Workspace
  11. Part.Position = Player.Character.Head.Position + Vector3.new(0, -5, 0)
  12.  
  13. function ePressed(inputObject, gameProcessedEvent)
  14.     if inputObject.KeyCode == Enum.KeyCode.E then
  15.         local Part = Instance.new("Part")
  16.         Part.Name = "Peça"
  17.         Part.Size = Vector3.new(6, 1, 6)
  18.         Part.Anchored = true
  19.         Part.Parent = game.Workspace
  20.         Part.Position = Player.Character.Head.Position - Vector3.new(0, 5, 0)
  21.         wait(5)
  22.         Part:Destroy()
  23.     end
  24.     if inputObject.KeyCode == Enum.KeyCode.F then
  25.         if Debounce == false then
  26.             Debounce = true
  27.         else
  28.             Debounce = false
  29.         end
  30.     end
  31. end
  32.  
  33. UIS.InputBegan:Connect(ePressed)
  34.  
  35. while wait() do
  36.     if Debounce == true then
  37.         Part.Transparency = 0
  38.         Part.CanCollide = true
  39.         Part.Position = Player.Character.Head.Position + Vector3.new(0, -5, 0)
  40.     else
  41.         Part.Transparency = 1
  42.         Part.CanCollide = false
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement