Proximity Prompt Teleporters

Hello, developer forum!
Today I was scripting my game and ran into a problem. I have recently decided to shift off of on player touch teleports to proximity prompt teleports. However, when making the switch I could get the teleporter done. Below is my script! Thanks for reading!

local interaction = script.Parent.ProximityPrompt

interaction.Triggered:Connect(function(plr)
local TeleportService = game:GetService(“TeleportService”)
local Place = 740581508

function onTouched(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player then
		TeleportService:Teleport(Place, player)
	end
end

script.Parent.Touched:Connect(onTouched)

end)

Try removing the onTouched function.

local interaction = script.Parent.ProximityPrompt

interaction.Triggered:Connect(function(plr)
local TeleportService = game:GetService("TeleportService")
local Place = 740581508

TeleportService:Teleport(Place, plr)

end)
8 Likes

So you wan to teleport only one player? Just like touched event? This post I made will help you.

3 Likes