This script is inside an invisible block, that has cancollide turned off. It is apart of a housing system btw. all locations are correct (iv'e checked),
script.Parent.Touched:Connect(function(hit)
local children = game.Players:WaitForChild(script.Parent.Parent.Info.OwnersName.Value):WaitForChild("PlayerSettings").HouseAccess:GetChildren()
for i = 1, #children do
if children[i].Name ~= hit.Parent.Name then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(152.74, 2.925, -205.96)
end
end
end)
as you can see the children are values in a folder, the values are called the players names, it is suppose to go through the for loop and if your player name is not one of the values Name (.Value doesn't work for some reason), then it tp's you outside of the invisible block.
What it actually does is tp everyone out of the invisible block, yes my player is added to the folder where the values are contained
EXTRA INFO PlayerSettings = a folder which gets cloned into the player (Game.Players), when the player joins the game
HouseAccess = folder inside PlayerSettings were all the players names that are allowed into the invisible block are stored, the owners name is automatically put into here.
ty NSMascot
