I'm making a camping game spinoff and i need help with a script when the car moves. When the car gets in the dark spot, it'll teleport. But it doesn't teleport when your sitting. When your sitting in the car, you are un-collidable. But when your not sitting, You are and you can teleport. Which makes you collidable. I made two scripts of it. But none of them worked. Here is the current script my dev team tried to fix :
-- Scripted by goldman201011 :3
--- 12/23/2019
local TeleportService = game:GetService("TeleportService")
local Place = 4535217403
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(Place, player)
end
end)
Here is my script I made :
-- Scripted by Skylark011 :3
--- 12/22/2019
local TeleportService = game:GetService("TeleportService")
local ID = 4535217403
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(ID, player)
end
end
script.Parent.Touched:Connect(onTouched)
So if you can help me, I'll really appreciate it.

2 comments
its supposed to use teleportservice. THE CAR is un-collidable. When you sit down in the car, you're un-collidable. Which makes the teleport not work. Even tried 2 kill scripts, guess what, it didn't work.
I don’t know what to say. The problem with your script does NOT have to do collision. Open the output window in your project and look if it gives an error. Note that you cannot be teleported within Roblox Studio, you must test the game for real.