LockerDoor.ProximityPrompt.Triggered:Connect(function(plr)
print('IT TRIGGER OH MY GOD PLEASE HELP ME')
if Taken == false then
if not plr:FindFirstChild('Safe') then
Taken = true
print('ok')
PersonHiding = plr
PersonCharacter = plr.Character
local SafeValue = Instance.new('BoolValue', PersonCharacter)
SafeValue.Name = "Safe"
SafeValue.Value = true
PersonCharacter.PrimaryPart.Anchored = true
LockerDoor.Breath:Play()
LockerDoor.Open:Play()
local GetInAnimation = TweenService:Create(
PersonCharacter.PrimaryPart,
TweenInfo.new(
0.3,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0
),
{
CFrame = Position_In.CFrame
}
)
GetInAnimation:Play()
end
end
if Taken == true then
print('exite')
if plr == PersonHiding then
print('exit')
PersonCharacter.PrimaryPart.Anchored = false
PersonCharacter:FindFirstChild('Safe'):Destroy()
local GetInAnimation = TweenService:Create(
PersonCharacter.PrimaryPart,
TweenInfo.new(
0.3,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0
),
{
CFrame = Position_Out.CFrame
}
)
GetInAnimation:Play()
wait(0.1)
FREE_LOCKER()
end
end
end)
This code is working fine, but when I trigger the proximity prompt, it automatically makes the player go out of the locker. How do I fix this? The functions are firing both at once. It’s very annoying.