Interpreting Greater-Than Values into Keycard Readers

Hey everyone, I want to script a keycard thingy so i dont have to waste 500 tools and stuff, but the script I want to do does not work :stuck_out_tongue: does anyone have the magic knowledge to help me out?

My Current Code:

local Target = "Keycard"
local Status = script.Status

Permisson = >=5 -- This is where the script breaks when i playtest

local ProximityPrompt = Instance.new("ProximityPrompt")
ProximityPrompt.Parent = script.Reader
ProximityPrompt.ActionText = "Scan Keycard" 
ProximityPrompt.ObjectText = "Cargo Lift"  	

ProximityPrompt.Triggered:Connect(function(Player)
	if Player:FindFirstChild("Backpack") and Player.Backpack:FindFirstChild(Target).Permission == Permisson then
		-- Code
		if Status == "Topside" then
			ProximityPrompt.Enabled = false
			script.Reader.Acceptance:Play()
			task.wait(3.440)
			script.Parent.Movement.Upwards.Disabled = false
			task.wait(20)
			Status = "Bottomside"
			ProximityPrompt.Enabled = true
		else
			ProximityPrompt.Enabled = false
			script.Reader.Acceptance:Play()
			task.wait(3.440)
			script.Parent.Movement.Downwards.Disabled = false
			task.wait(15)
			Status = "Topside"
			ProximityPrompt.Enabled = true
	end
	else 
		script.Reader.Denial:Play()
	end

end)

Would be cool if this were to work at all.

Not sure If I’m just reading your script wrong, but at your first “if” statement

if Player:FindFirstChild("Backpack") and Player.Backpack:FindFirstChild(Target).Permission == Permisson then

Couldn’t you just change it to:

if Player:FindFirstChild("Backpack") and Player.Backpack:FindFirstChild(Target).Permission.Value >= Permisson then

and then change permission to:

Permission = 5

That way if the keycards permission level is 5 or higher you can use the cargo lift but any lower permission will be rejected.

Please let me know if I’m just reading your script wrong.

Note: This is asumming under your Keycard you have an IntValue holding the permission level of the card.

1 Like

Thanks bro that did it, very much appreciated <3