I have made a keycard-like entrance that requires the player to hold and item and touch a secret object, but instead of opening some kind of door it teleports them to a place within the same game, so it's not putting them in a different game. Here is my code:
script.Parent.Bottle.Touched:Connect(function(hit)
print("touched")
if hit.Parent.Name == "Key" then
print("teleport")
game.Workspace.Player.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(96, 2.5, 48.5))
end
end)
PS, the prints are for me debugging my code. The error I get is that Player is not a member of Workspace.

1 comment
Thanks! Also thanks for the extra info with the tools being parented to the character, that will definitely help in the future.