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

Proximity Prompt stops working after 5-8 uses?

So I have a proximity prompt on both sides of the door that teleport me on the other side after using the proximity prompt.

It works completely fine with no errors for about 5-8 times before it just stops working.

No errors or anything, the circle goes around the E completely but nothing happens. I have no idea why it stops working after a certain amount of uses.

local Tpin = script.Parent.TpInsideRoom
local Tpout = script.Parent.TpOutsideRoom

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		print("1")
		local humanoid = character.HumanoidRootPart
		print("2")
		script.Parent.inknob.ProximityPrompt.Triggered:Connect(function(player)
			print("3")
			humanoid.Position = Tpout.Position
			print("4")
		end)
	end)
end)



game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		print("5")
		local humanoid = character.HumanoidRootPart
		print("6")
		script.Parent.out.ProximityPrompt.Triggered:Connect(function(player)
			print("7")
			humanoid.Position = Tpin.Position
			print("8")
		end)
	end)
end)

1 answer

You should not have the Triggered events inside the PlayerAdded and CharacterAdded events. You can use the player parameter from the Triggered event to teleport the player.

2 comments

0

Sorry im new to this, could you post the code, because now im getting errors that position is not a valid member of players.administrativefellow @Vong25

0

You have to use the Character property of the player to get the player. Then, path to the HumanoidRootPart and set its position.

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