#wont teleport to the part

1 messages · Page 1 of 1 (latest)

wooden basin
#

im trying to make a teleport move that tps you to a room, and back where you originally tped from, it does teleport you to the room and makes a part from where u teleported from but you cant go back

local name = character.Name

print(name)

ev1.Event:Connect(function(a)
    ev2:FireServer()
    hrp.CFrame = To.CFrame
end)

del2.Event:Connect(function(a)
    for i, parts in pairs (workspace) do
        if parts:IsA("Part") and parts.Name == name then
            hrp.CFrame = parts.CFrame
        end
    end
end)

this is a local script inside of starter character scripts

#

it teleports you back by finding a part that has your name that was made in another script then its supposed to destroy it afterwards

#
local ev1 = game.ReplicatedStorage.CorruptDude.Teleports:WaitForChild("make block")
local ev2 = game.ReplicatedStorage.CorruptDude.Teleports:WaitForChild("delete block")
local character = script.Parent.Parent
local To = game.Workspace.Room:WaitForChild("Teleporter")

local hrp = character:WaitForChild("HumanoidRootPart")

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        game.ReplicatedStorage.ignore:FireClient()
    end)
end)

if hrp then
    print("found itt")
end

ev1.OnServerEvent:Connect(function(plr)
    local block = Instance.new("Part")
    block.Name = plr.Name
    block.Parent = game.Workspace
    block.Anchored = true
    block.CanCollide = false
    block.Size = Vector3.new(10,10,10)
    block.Transparency = 1
    ev2.OnServerEvent:Connect(function(plr)
        block:Destroy()
        print("deleted")
    end)
end)

this script makes the block