so, I have this script:
local TweenService = game:GetService("TweenService") local door = workspace.Door local doorRoot = door.PrimaryPart local DoorSwingInfo = TweenInfo.new() local DoorSwingTween = TweenService:Create(doorRoot, DoorSwingInfo, { CFrame = doorRoot.CFrame * CFrame.Angles(0, math.rad(95),0) }) game.Workspace.Door.ProximityPrompt.Triggered:Connect(function(Player) if Player:WaitForChild("Backpack"):FindFirstChild("Key") then game.Workspace.Door.ProximityPrompt.Enabled = false DoorSwingTween:Play() end end)
and my problem is when I hold the key and I open the door with the proximityprompt it doesn't work, it only works when i do not hold it. and I probably know it's because the "WaitForChild("Backpack"), that's why its not working... but what should I put instead of "Backpack", since "Hand" doesn't work.
Thanks!
if Player:WaitForChild("Backpack"):FindFirstChild("Key") or Player.Character:FindFirstChild("Key") then end