local DSS = game:GetService("DataStoreService")
local Storage = DSS:GetDataStore("Score")
local Door = script.Parent
local GoTo = game.Workspace.GardenAreaTP
local debounce = true
game:GetService("Players").PlayerAdded:Connect(function(player)
local bool = Instance.new("BoolValue")
bool.Name = "RemoveDoor1"
bool.Value = false
bool.Parent = player
local success, result = pcall(function()
Storage:GetAsync(player.UserId)
end)
if not success then
warn(result)
else
local LoadValue = Storage:GetAsync(player.UserId)
if LoadValue then
bool.Value = LoadValue
print(bool.Value)
end
end
end)
game:GetService("Players").PlayerRemoving:Connect(function(player)
Storage:SetAsync(player.UserId, player:WaitForChild("RemoveDoor1").Value)
end)
Door.Touched:Connect(function(hit)
if debounce == false then return end
debounce = false
print("Door Hit")
local human = hit.Parent:FindFirstChild("Humanoid")
if human ~= nil then
print("Human touched door")
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
local sp = player:WaitForChild("leaderstats"):WaitForChild("Coins")
local check = player:WaitForChild("RemoveDoor1")
if check.Value == false and sp.Value >= 1000000 then
print("Human passed test")
check.Value = true
sp.Value = sp.Value - 1000000
player:WaitForChild("Humanoid").CFrame = CFrame.new(GoTo.Position)
elseif check.Value == true then
print("Human already has access")
player:WaitForChild("Humanoid").CFrame = CFrame.new(GoTo.Position)
end
end
end
debounce = true
end)
That is my script and i want the player to be teleported to the parts position. Everything works its just the error is in like line 48 and 51. Somebody help meehh,

2 comments
try doing player.Character:WaitForChild("Humanoid") instead of player:WaitForChild("Humanoid")
The mistake is very clear... You didn't define what "player" actually is.