Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a teleporter that only works with a certain badge?

Asked by 6 years ago

Okay, so I got the "checking if the player has a certain badge" script done, but I really want to make a teleporter that only works if you have that badge.

And considering I know little to nothing about scripting, I don't know what to do now here hhh

pls dont kill me

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Reminder: scriptinghelpers is not a request site (thus I will not be providing you an actual script, but rather information to help you).

For your teleporter, you will first need to check if the user owns the badge (which you say you can already do) (this is probably best as an if statement inside wherever the teleporter code will be). After this, provided the user owns the badge - you need to teleport them. This can be done multiple ways, a few common ones are:

Player.Character:SetPrimaryPartCFrame([CFrame])
Character.HumanoidRootPart.CFrame = CFrame.new([Position])

etc...

Once you have tried to do this on your own, and have proof in code that you have tried to - then I would either amend this question or make a new one asking for help with whatever difficulties you may be continuing to have.

0
Thanks man! It worked! Skeleyyy 9 — 6y
Ad
Log in to vote
0
Answered by
Hizar7 102
6 years ago
Edited 6 years ago

if the badge is some kind of value inside the player, just have a script look to see if they have the badge, with the function you use to teleport, so its its a touched function do this Teleporter will be the Part that Teleports and badgeFolder will be where the badge value is kept.

local teleporter = game.Workspace.Teleporter
teleporter.Touched:Connect(Function(hit)
if hit.Parent.BadgeFolder.Badge.Value >= 1 then -- Whatever value you have as the badge 
--[[
Do the teleport you have here 
]]
    end 
end) 

let me know if this works

Answer this question