How can I make a badge only game teleporter using a proximity prompt?

Hey Developers!

I’m trying to figure out how to create a game teleporter that only lets you teleport if you own a badge using a proximity prompt but nothing seems to be working. I’m not the best at scripting so if there is anyone that can help me out I would really appreciate it. Thanks!

1 Like

I’m not entirely sure what you’re asking for, but something like this should work:

local badgeService = game:GetService("BadgeService")
local teleportService = game:GetService("TeleportService")
workspace.Baseplate.ProximityPrompt.Triggered:Connect(function(player)
	if badgeService:UserHasBadgeAsync(player.UserId,2127715318) then
		teleportService:TeleportAsync(1818,{player})
	end
end)

1 Like

Yes that’s perfect thank you so much!

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