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)