-
What do you want to achieve? A door that only accepts certain IDs/keycards.
-
What is the issue? It doesn’t let an allowed ID in, and allows invalid IDs in, and sometimes it just breaks like this:
robloxapp-20201212-1827233.wmv (2.6 MB) -
What solutions have you tried so far? I suck at wording these problems so it’d just be better for me to make a new topic.
Here is the code:
TS = game:GetService("TweenService")
TP = TweenInfo.new(1)
script.Parent.ProximityPrompt.PromptButtonHoldBegan:Connect(function()
script.Parent.Swipe:Play()
end)
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
for i,v in pairs (player:GetDescendants()) do
if v.Name == 'ID' then
if v.Value.Value == 'Owner' or 'Miner' or 'QA' or 'Transport' or 'Site Worker' or 'Visitor' then
script.Parent.Valid:Play()
local tween = TS:Create(script.Parent,TP, {Color = Color3.fromRGB(0, 255, 0)})
tween:Play()
wait(1)
local tween = TS:Create(script.Parent,TP, {Transparency = 1})
tween:Play()
wait(1)
script.Parent.CanCollide = false
wait(5)
script.Parent.CanCollide = true
script.Parent.Color = Color3.fromRGB(255, 255, 255)
local tween = TS:Create(script.Parent,TP, {Transparency = 0})
tween:Play()
wait(1)
else if v.Value.Value ~= 'Visitor' or 'Miner' or 'QA' or 'Transport' or 'Site Worker' then
script.Parent.Invalid:Play()
local tween = TS:Create(script.Parent,TP, {Color = Color3.fromRGB(255, 0, 0)})
tween:Play()
wait(1)
local tween = TS:Create(script.Parent,TP, {Color = Color3.fromRGB(255, 255, 255)})
tween:Play()
wait(1)
end
end
end
end
end)
What is meant to happen is for the IDs of Visitor, Miner, and Transport to work. The ID with the tooltip/value of ‘Site Noob’ should not work. Help is much appreciated!