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???
#Teleportation Situation
60 messages · Page 1 of 1 (latest)
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?
anyone?
Can I ask what are you trying to do?
FindFirstChild not findFirstChild
if h==Humanoid?
Well, it is a teleportation a scripter dev of mine did
** You are now Level 7! **
take ur time
Wait, what you want to do is a normal teleporter
If you touch a part it sends you to the location that you mention?
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
Why did you go so long on the code?
That was my dev's scripting
Ok, give me a few moments while the studio updates
Oki
I think I did what was not
the problem was that it got bugged when you used the teleporter many times?
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 💀
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
I think I could do the same, a little more simple and functional
Including the transition
if u can, that be great :)
i'd be glad to even pay you
Ok
u know u can shorten that
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