Lucasluz

TELEPORTE

Sep 28th, 2024
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.43 KB | None | 0 0
  1. -- Script de Teleporte
  2.  
  3. local player = game.Players.LocalPlayer
  4. local TeleportEnabled = false
  5. local previousPosition
  6.  
  7. -- Função para criar os efeitos visuais do teleporte
  8. local function createTeleportEffects(position)
  9.     local fireBall = Instance.new("Part")
  10.     fireBall.Size = Vector3.new(2, 2, 2)
  11.     fireBall.Position = position + Vector3.new(0, 10, 0)
  12.     fireBall.BrickColor = BrickColor.new("Bright red")
  13.     fireBall.Material = Enum.Material.Neon
  14.     fireBall.Anchored = true
  15.     fireBall.CanCollide = false
  16.     fireBall.Parent = workspace
  17.  
  18.     local fireEffect = Instance.new("Fire", fireBall)
  19.     fireEffect.Size = 10
  20.     fireEffect.Heat = 10
  21.  
  22.     local smoke = Instance.new("Smoke")
  23.     smoke.Size = 5
  24.     smoke.Color = Color3.fromRGB(255, 255, 255)
  25.     smoke.Parent = fireBall
  26.  
  27.     local groundFire = Instance.new("Part")
  28.     groundFire.Size = Vector3.new(4, 1, 4)
  29.     groundFire.Position = position
  30.     groundFire.BrickColor = BrickColor.new("Bright orange")
  31.     groundFire.Material = Enum.Material.Neon
  32.     groundFire.Anchored = true
  33.     groundFire.CanCollide = false
  34.     groundFire.Parent = workspace
  35.  
  36.     local fireOnGround = Instance.new("Fire", groundFire)
  37.     fireOnGround.Size = 5
  38.     fireOnGround.Heat = 10
  39.  
  40.     game:GetService("Debris"):AddItem(fireBall, 5)
  41.     game:GetService("Debris"):AddItem(groundFire, 5)
  42. end
  43.  
  44. -- Função para teleportar o jogador
  45. local function teleportToPosition(position)
  46.     if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  47.         previousPosition = player.Character.HumanoidRootPart.Position
  48.         player.Character.HumanoidRootPart.CFrame = CFrame.new(position)
  49.         createTeleportEffects(position)
  50.     end
  51. end
  52.  
  53. -- Ferramenta de teleporte
  54. local TeleportItem = Instance.new("Tool")
  55. TeleportItem.Name = "Teleporte"
  56. TeleportItem.RequiresHandle = false
  57. TeleportItem.Parent = player.Backpack
  58.  
  59. -- Script de Teleporte (continuação)
  60.  
  61. -- Teleporte quando o jogador clicar
  62. TeleportItem.Activated:Connect(function()
  63.     local mouse = player:GetMouse()
  64.     if mouse.Target then
  65.         local targetPosition = mouse.Hit.p
  66.         teleportToPosition(targetPosition)
  67.     end
  68. end)
  69.  
  70. -- Ativar/desativar o teleporte
  71. TeleportEnabled = not TeleportEnabled
  72. if TeleportEnabled then
  73.     TeleportItem.Parent = player.Backpack
  74. else
  75.     if player.Backpack:FindFirstChild("Teleporte") then
  76.         player.Backpack.Teleporte:Destroy()
  77.     end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment