Teleporters not working as intended

So I have these teleporters and they are not working as intended here is the vid

https://gyazo.com/a16c5ef05b47cd726f12ac06eca1cbbd

Idk what to do

We can’t help you either.

There is no code.

Let me send the script

local Teleport_To_This_Tag = “0001”

function findTele(tag)
local tele = nil
function scan(p)
for _,v in pairs(p:GetChildren()) do
if ((v.Name == “Telepad”) and (v:findFirstChild(“Tag”))) then
if (v.Tag.Value == tag) then tele = v break end
end
if (#v:GetChildren() > 0) then scan(v) end
end
end
scan(game:service(“Workspace”))
return tele
end

script.Parent.Touched:connect(function(h)
local p = game:service(“Players”):GetPlayerFromCharacter(h.Parent)
if not (p) then return end
if (p:findFirstChild(“JustTeleported”)) then return end
if not (findTele(Teleport_To_This_Tag)) then return end
local tele = findTele(Teleport_To_This_Tag)
if (tele) then
if (p.Character) then
p.Character:MoveTo(tele.CFrame.p+Vector3.new(0,3.25,0))
local t = Instance.new(“Weld”)
t.Name = “JustTeleported”
t.Parent = p
delay(1.5,function() t:remove() end)
end
end
end)

Please format it within ```

Like so:

Test

Just by looking at it though when you are teleporting player your adding 3.25 studs to the y axis leading them to be above the submarine.

Oh sorry my bad

So I don’t know how to do that so I made a postbin

Change this line

p.Character:MoveTo(tele.CFrame.p+Vector3.new(0,3.25,0))

to

p.Character:MoveTo(tele.CFrame.p)

Also I recommend teleporting the player with HumanoidRootPart.CFrame() instead.

1 Like

Unfortunately it didn’t work :frowning:

What was the issue? Provide what happended.

Like I said I spawn on top again

What’s happening is that your character is teleporting into a object or not enough height clearance and it’s pushing you to the surface or your teleporter itself is positioned wrong.

It is is not a high enough clearence and it is positioned where there is plenty of room.

https://gyazo.com/ba5d873aef0a005d2f575531b516206e

try

p.Character:SetPrimaryPartCFrame(tele.CFrame + Vector3.new(0,3.25,0))

1 Like

Now it won’t let me teleport to the sub.

I am getting this error https://gyazo.com/9369a6bf875a827042942799201cf9e7 when I do your code

yeah my bad i forgot an extra parenthesis after Vector3.new(0,3.25,0)

So how is the whole code with the updated code.

i used

p.Character:SetPrimaryPartCFrame(tele.CFrame + Vector3.new(0,3.25,0))

in a test place and it seemed to work

It worked ty so much, I have another issue tho

I need it to drive with the sub

This is the model