Hey there! I was having troubles on my script, where it's supposed to TP a player only if they are friends with me.

SCRIPT ONE

game.Players.PlayerAdded:Connect(function(player) if player:IsFriendsWith(99350822) then

end

end)

SCRIPT TWO

local Teleport = "base_enterance" --Put the name of the Part between the ""s. function Touch(hit) --Indicates that the Part has been Touched. if script.Parent.Locked == false and script.Parent.Parent:findFirstChild("base_tp").Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild("base_tp").Locked = true --Checks Debounce. local Pos = script.Parent.Parent:findFirstChild("base_tp") --Gets the Part to teleport to. hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild("base_tp").Locked = false end end --Takes you there and Ends the Function. script.Parent.Touched:connect(Touch) --Listens out for Touchers.

1 comment

0

Please organize your script in a code block