IanLI

Script de Teletransportación

Jan 13th, 2021
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. Aquí esta el script de teletransportación:
  2.  
  3. script.Parent.Touched:Connect(function(Touch)
  4.     local HumanoidRootPart = Touch.Parent:FindFirstChild("HumanoidRootPart")
  5.     if HumanoidRootPart then
  6.         HumanoidRootPart.CFrame = Vector3.new(-> Borra esto y escribe la posición)
  7.         print("-> Posicion")
  8.     end
  9. end)
  10.  
  11. Aquí esta el script de teletransportación a un lugar aleatorio:
  12.  
  13. local Y
  14. local X
  15.  
  16. script.Parent.Touched:Connect(function(Touch)
  17.     local HumanoidRootPart = Touch.Parent:FindFirstChild("HumanoidRootPart")
  18.     if HumanoidRootPart then
  19.         X = math.random(-> Valor X minimo, -> Valor X máximo)
  20.         Y = math.random(-> Valor Y minimo, -> Valor Y máximo)
  21.         HumanoidRootPart.CFrame = Vector3.new(X, Y, -> Valor Z)
  22.         print("Teleported to: " .. X .. ", " .. Y .. ", -> Valor Z")
  23.     end
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment