Im trying to make a door, and when you click on the handle it teleports you inside the room
> function onClicked(plr)
if plr.Name == "Bylli_Oruze" or plr.Name == script.Parent.Parent.Parent.CurrentOwner.Value then
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(script.Parent.Parent.In.Position)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
"In" is a little part on the other side of the door that represents where the player should be moved to (There is also an "Out" part on the outside of the door for when the player wants to leave the room)
the "If plr.Name" Part is for the house script im trying to make, i put my name as the creator should have access to all the houses no matter what
im not sure where i went wrong

4 comments
Its a normal script, but i really dont understand what to do
ive tried plr.Character etc but that didnt work, ive tried plr.HumanoidRootPart etc but that didnt work either, so im pretty much stuck
use playeradded events on player service
^not a clue what that means