#I am new at scripting, can someone help me out?

1 messages · Page 1 of 1 (latest)

ruby wraith
#

I am trying to make a simple locker that let's you enter it and exit it, I used proximity prompts to accomplish this. When you enter the locker the enter locker prompt disapears, and the exit locker prompt is enabled. For some reason when I leave the locker the enter prompt appears for one second and proceeds to disapear, can someone help ._.?

#

Here is the script to enter the locker: local ProximityPrompt = script.Parent
local Floor = script.Parent.Parent.Parent.Floor
local inUse = script.Parent.Parent.Parent.InUse

while true do
repeat wait() until inUse.Value == false
ProximityPrompt.Enabled = true
break
end

ProximityPrompt.Triggered:Connect(function(plr)
local char = plr.Character
local rootPart = char:FindFirstChild("HumanoidRootPart")
rootPart.CFrame = Floor.CFrame
inUse.Value = true
if inUse.Value == true then
ProximityPrompt.Enabled = false
end
end)

#

And to exit: local ProximityPrompt = script.Parent
local Exit = script.Parent.Parent.Parent.Exit
local inUse = script.Parent.Parent.Parent.InUse

while true do
repeat wait() until inUse.Value == true
ProximityPrompt.Enabled = true
break
end

ProximityPrompt.Triggered:Connect(function(plr)
local char = plr.Character
local rootPart = char:FindFirstChild("HumanoidRootPart")
rootPart.CFrame = Exit.CFrame
inUse.Value = false
if inUse.Value == false then
ProximityPrompt.Enabled = false
end
end)

cinder crater
#

WAZZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH