local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
print(char.Name)
local folder = workspace.Doors
local collectibles = workspace.Collectibles
local path = folder.EntranceDoor
for i, v in pairs(folder:GetChildren()) do
v.Touched:Connect(function(hit)
if hit.Name == "KeyOpener" then
--local tool = char:WaitForChild("Entrance Key")
--warn(tool)
path.Open:Play()
path.Anchored = false
path.CanCollide = false
--tool:Destroy()
end
end)
end
end)
end)
(ServerScript) Any idea why the code snippets with dashes don't work and break the script?