Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Teleporter always teleports me above block?

So I made a sound region, made it massless and CanCollide is set to false, and when I teleport through it, it always puts me at the very top and it takes like 5 seconds to fall back down. It's very annoying when your trying t o make a professional game, specially on a timer.

This is a simple noobie glitch, do you know?

local Player = game.Players.LocalPlayer
local Location = game.Workspace.Locations.SellTeleport
local TeleportButton = script.Parent
local HasPressedTeleport = false

function TeleportPlayer()
	if HasPressedTeleport == false then
		local Module = require(script.Parent.Parent.Parent.Parent.UIModule)
		spawn(Module.QuickScreen)
		wait(1)
		Player.Character:CFrame(Location.Position)

	end
end

TeleportButton.MouseButton1Down:connect(TeleportPlayer)

2 comments

0

How are you teleporting people? With :MoveTo or .Position?

0

I just put the code in the bio

1 answer

✓ Accepted answer

You probably use :MoveTo, it's same what roblox spawners use, that's why they are bad, it gets the highest free position, instead, use .CFrame, if you have a character, it would look like this

local RootPart = Character.HumanoidRootPart

RootPart.CFrame = Region.CFrame + Vector3.new(0, 4 - Region.Size.Y / 2, 0

0, 4, 0 is size of your character, it prevents you from spawning inside of the part, to not spawn in the middle of the region, which would take 2.5 seconds to fall, you remove half of the region size in the offset.

This discussion is preserved as it was. New answers, comments, and votes are closed.