Teleporter part not working

thanks for helping me with the teleporter. it does not work rn but if you find a solution then thanks:D

1 Like

Try to do this I’m sure it will help you.

i dont like using free models.

Ok so can you explain again what exactly you want to do?

Just to Sum up.

For right now I believe this works:

I don’t ask you to use a free model, but to compare the script of some free models to your script.

Im just trying to make a teleporter and when you teleport you need to wait 5 seconds to teleport back if you touch a part. for expample

teleport1 is touched then teleport to teleporter 2
wait 5 seconds and then you can teleport back too teleport 1 by touching teleport 2.

local Debounce = false
local WaitTime = 5
local Pos = nil -- Teleporter name (Ex. game.Workspace.TP1)

script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild(ā€œHumanoidā€)
if hum then
if not Debounce then

Debounce = true

local Plr = game.Players:GetPlayerFromCharacter(hit.Parent)
     if Plr then
Plr.Character:SetPrimaryPartCFrame(Pos.CFrame + Vector3.new(0,2,0)) 
     end

task.wait(WaitTime)

Debounce = false
end
end
end)

Edited @DasKairo script

You didn’t need to do that, GetPlayerFromCharacter gets the Player without the Humanoid, my script works without Humanoid

It will check for a humanoid or else any part it touches will activate debounce.

unkown global: Pos. thats the error.

it’s late at night for me so i was a bit tired making this, but hopefully this works

local Teleport = script.Parent.Parent:FindFirstChild("teleport2")
local debounce = false

function Touch (hit) 
	if hit.Parent:FindFirstChild("Humanoid") and not debounce and not script.Parent.Locked then 
		debounce = true
		Teleport.Locked = true
		
		local Pos = Teleport
		hit.Parent:FindFirstChild("HumanoidRootPart"). CFrame = CFrame.new(Pos.Position)
		wait(5) -- you can change this to however long you want the wait time to be
		debounce = false
		Teleport.Locked = false
		
	end
end

script.Parent.Touched:Connect(Touch)

:crossed_fingers:

2 Likes

Yeah, you gotta path Pos, i edited it so you can path it now.

You need to specify that, I explained that here

Thats why this is here:

local Plr = game.Players:GetPlayerFromCharacter(hit.Parent)
     if Plr then -- Checks if Player
Plr.Character:SetPrimaryPartCFrame(Pos.CFrame + Vector3.new(0,2,0)) 
     end

You use Humanoid in Touched for Humanoid Related Items like Health, and WalkSpeed, You use GetPlayerFromCharacter for Data Changes, Teleporting, etc

I swear, yall just adding unnesecary changes

did you really try to steal my money. i trying your script. guess what it says.

you dont have enough payments, your account has not been charged.

nevermind, i used a free model and it was trying to take my money. i apologize.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.