Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script disables a proximity prompt if the players Access ~= the table. It wont work?

Asked by
ovicaI 7
3 years ago
Edited 3 years ago

Hello, I am VERY NEW to scripting, so please dumb things down and please do not shame me;

This code will, for some reason, not work.

The purpose of the script; It disables a proximity prompt in a door if the players Access value does not equal anything inside the table.

Code (Localscript): 

local player = game.Players.LocalPlayer
local allowed = {"L5"}
local Access = player.Access.Value
for i,v in pairs(Access) do
    if v == allowed[1] then
        script.Parent.ProximityPrompt.Enabled = true
    else
        script.Parent.ProximityPrompt.Enabled = false
    end

end
0
A good way to troubleshoot is to use print("what should happen") Ashedee 43 — 3y
0
It did not print anything, even if I put the print at the beginning of the script. What could be happening? ovicaI 7 — 3y
0
if it is not printing anything then the table isn't working right. or maybe you need to run it from the server. if you change Access to a part instead of that value I bet it would work. Ashedee 43 — 3y

Answer this question