-
Notifications
You must be signed in to change notification settings - Fork 309
Description
LocalScript dentro del Frame
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- Esperar a que el personaje cargue
local function getCharacter()
if player.Character then
return player.Character
else
return player.CharacterAdded:Wait()
end
end
-- Elementos de GUI
local frame = script.Parent
local tpButton = frame:WaitForChild("TPButton")
local tp2Button = frame:WaitForChild("TP2Button")
local trasButton = frame:WaitForChild("TrasButton")
-- Posición guardada
local savedPosition = nil
-- Guardar posición
tpButton.MouseButton1Click:Connect(function()
local character = getCharacter()
local hrp = character:WaitForChild("HumanoidRootPart")
savedPosition = hrp.Position
print("📍 Posición guardada:", savedPosition)
end)
-- Teletransportarse
tp2Button.MouseButton1Click:Connect(function()
if savedPosition then
local character = getCharacter()
local hrp = character:WaitForChild("HumanoidRootPart")
hrp.CFrame = CFrame.new(savedPosition)
print("🚀 Teletransportado")
else
warn("❌ No hay posición guardada.")
end
end)
-- Traspasar (NoClip temporal)
local RunService = game:GetService("RunService")
local noclip = false
local function setNoclip(state)
noclip = state
end
RunService.Stepped:Connect(function()
if noclip then
local character = player.Character
if character then
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
end
end
end)
trasButton.MouseButton1Click:Connect(function()
print("👻 Traspasando por 5 segundos")
setNoclip(true)
task.delay(5, function()
setNoclip(false)
local character = player.Character
if character then
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = true
end
end
end
print("🔒 NoClip desactivado")
end)
end)