#Teleportation Situation

60 messages · Page 1 of 1 (latest)

grim sail
#

Hi, me again. I'm having a situation where when I get into "Tele1". I teleport to "Tele2", Nothing wrong. BUT, When I step back to "Tele2" to teleport back to "Tele1".. I get stuck somewhere. It's normal and working fine when inside the baseplate, but when I place it on my map, It bugs. What do i do???

#

Tele1 Script:

`modelname="tele2"

function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local teleportfrom=script.Parent.Enabled.Value
if teleportfrom~=0 then
if h==humanoid then
return
end
local teleportto=script.Parent.Parent:findFirstChild(modelname)
if teleportto~=nil then
local torso = h.Parent.Torso
local location = {teleportto.Position}
local i = 1

                local x = location[i].x
                local y = location[i].y
                local z = location[i].z
            
                x = x + math.random(-1, 1)
                z = z + math.random(-1, 1)
                y = y + math.random(2, 3)

                local cf = torso.CFrame
                local lx = 0
                local ly = y
                local lz = 0
                
                script.Parent.Enabled.Value=0
                teleportto.Enabled.Value=0
                pcall(function()fg=script.Parent.Parent.FadeGui:clone() fg.Parent=game:service("Players"):GetPlayerFromCharacter(torso.Parent).PlayerGui end)
                for i = 1,-0.05,-0.05 do pcall(function() fg.Fade.BackgroundTransparency = i end) wait() end
                wait(0.1) torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz)) wait(0.2)
                for i = 0,1.05,0.05 do pcall(function() fg.Fade.BackgroundTransparency = i end) wait() end pcall(function() fg:remove() end) wait(1)
                script.Parent.Enabled.Value=1
                teleportto.Enabled.Value=1
            else
                print("Could not find teleporter!")
            end
        end
    end
end

end

script.Parent.Touched:connect(onTouched)`

#

Tele2 Script:

`modelname="tele1"

function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local teleportfrom=script.Parent.Enabled.Value
if teleportfrom~=0 then
if h==humanoid then
return
end
local teleportto=script.Parent.Parent:findFirstChild(modelname)
if teleportto~=nil then
local torso = h.Parent.Torso
local location = {teleportto.Position}
local i = 1

                local x = location[i].x
                local y = location[i].y
                local z = location[i].z
            
                x = x + math.random(-1, 1)
                z = z + math.random(-1, 1)
                y = y + math.random(2, 3)

                local cf = torso.CFrame
                local lx = 0
                local ly = y
                local lz = 0
                
                script.Parent.Enabled.Value=0
                teleportto.Enabled.Value=0
                pcall(function()fg=script.Parent.Parent.FadeGui:clone() fg.Parent=game:service("Players"):GetPlayerFromCharacter(torso.Parent).PlayerGui end)
                for i = 1,-0.05,-0.05 do pcall(function() fg.Fade.BackgroundTransparency = i end) wait() end
                wait(0.1) torso.CFrame = CFrame.new(Vector3.new(x,y-8,z), Vector3.new(lx,ly,lz)) wait(0.2)
                for i = 0,1.05,0.05 do pcall(function() fg.Fade.BackgroundTransparency = i end) wait() end pcall(function() fg:remove() end) wait(1)
                script.Parent.Enabled.Value=1
                teleportto.Enabled.Value=1
            else
                print("Could not find teleporter!")
            end
        end
    end
end

end

script.Parent.Touched:connect(onTouched)`

#

I know it's alot, they seem to be the same script but a little different?

grim sail
#

anyone?

true cloak
#

Can I ask what are you trying to do?

#

FindFirstChild not findFirstChild

#

if h==Humanoid?

grim sail
orchid lanternBOT
#

studio** You are now Level 7! **studio

grim sail
#

I have the video on how it works

true cloak
#

you can just do this

#

give a minute

grim sail
#

take ur time

true cloak
#

Wait, what you want to do is a normal teleporter

#

If you touch a part it sends you to the location that you mention?

grim sail
#

yes

#

but problem is

#

when it's placed on a baseplate

#

it works fine

#

but when on a different part or block

#

it starts to bug out

true cloak
#

Why did you go so long on the code?

grim sail
true cloak
#

Ok, give me a few moments while the studio updates

grim sail
#

Oki

true cloak
#

I think I did what was not

#

the problem was that it got bugged when you used the teleporter many times?

grim sail
#

well no, it wasnt used many times

#

i grabbed the file and it worked fine on a baseplate

#

at the end, i flopped down

#

holy shit, i just realized the video being laggy 💀

true cloak
#

What are those x y and z values?

#

I don't understand your script

grim sail
#

Well im not a scripter

#

like I said, this is my developers work

#

i own a game, so my developer made this teleportation system

#

I feel like the x y and z values thing is for like, the fading gui perhaps

true cloak
#

I think I could do the same, a little more simple and functional

#

Including the transition

grim sail
#

i'd be glad to even pay you

true cloak
#

Ok

#

Add me to studio

#

AlejandroSnap

#

Roblox name

grim sail
#

you might need to join the group and i have to friend

#

i'll dm the link for my group

true cloak
#

Ok

grim sail
#

so its like this ```lua
local modelname = "tele1"

local function onTouched(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid and script.Parent.Enabled.Value ~= 0 and humanoid ~= humanoid then
local teleportto = script.Parent.Parent:FindFirstChild(modelname)
if teleportto then
local torso = humanoid.Parent.Torso
local pos = teleportto.Position
pos = pos + Vector3.new(math.random(-1, 1), math.random(2, 3), math.random(-1, 1))

        script.Parent.Enabled.Value = 0
        teleportto.Enabled.Value = 0
        local fg = script.Parent.Parent.FadeGui:Clone()
        fg.Parent = game.Players:GetPlayerFromCharacter(torso.Parent).PlayerGui
        for i = 1, 0, -0.05 do
            fg.Fade.BackgroundTransparency = i
            wait()
        end
        wait(0.1)
        torso.CFrame = CFrame.new(pos, pos - Vector3.new(0, 8, 0))
        wait(0.2)
        for i = 0, 1, 0.05 do
            fg.Fade.BackgroundTransparency = i
            wait()
        end
        fg:Destroy()
        wait(1)
        script.Parent.Enabled.Value = 1
        teleportto.Enabled.Value = 1
    else
        print("Could not find teleporter!")
    end
end

end

script.Parent.Touched:Connect(onTouched)```

#

and do or Character.LowerTorso since it can do a R6 rig or R15

grim sail
#

so its it a Script to teleport player to a new location

#

so

#

do i place the new script that u did

#

on the part?

#

if u want to