I want to check if a player went through the doors. Not sure how can I do that.
Code. Yes, I know i couldve done local part = script.Parent.Parent.Parent.Parent
local Players = game:GetService("Players")
script.Parent.Parent.Parent.Enter.Triggered:Connect(function(p)
local userId = p.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size48x48
local success, err = pcall(function()
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
script.Parent.Image.Image = content
script.Parent.Parent.Parent.pName.pName.Text = p.Name
script.Parent.Parent.Parent.Parent.Doors.CanCollide = false
script.Parent.Parent.Parent.Parent.Signal.Color = Color3.fromRGB(75, 151, 75)
script.Parent.Parent.Parent.Parent.Signal2.Color = Color3.fromRGB(75, 151, 75)
task.wait(5)
script.Parent.Image.Image = 0
script.Parent.Parent.Parent.Parent.Doors.CanCollide = true
script.Parent.Parent.Parent.pName.pName.Text = ""
script.Parent.Parent.Parent.Parent.Signal.Color = Color3.fromRGB(255, 0, 0)
script.Parent.Parent.Parent.Parent.Signal2.Color = Color3.fromRGB(255, 0, 0)
end)
if not success then
print("Problem showing user's image. "..err)
end
end)```