I know there is a ton wrong with this script, can someone explain how to fix the issues. THANKS
function onPlayerEntered(newPlayer)
local IDone=222805421
local IDtwo=222807114
if game:GetService("GamePassService"):PlayerHasPass(newPlayer,IDone)then
print (newPlayer.."has testing permission")
if game:GetService("GamePassService"):PlayerHasPass(newPlayer,IDtwo)then
print (newPlayer.."has V.I.P.")
if not game:GetService("GamePassService"):PlayerHasPass(newPlayer,IDtwo) and
not game:GetService("GamePassService"):PlayerHasPass(newPlayer,IDone) then
print (newPlayer.."is a visitor")
end
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)
EDIT FOR DIITTO
local PassRank={}; --I removed the setHealth function for what im trying to do, but I saved it to my models.
function assertPlayer(Player)
if(PassSettings[Player.Name].VIP)then
newPlayer.PlayerGui.VIPBlock:Remove() --Doesn't do this
end;
if(PassSettings[Player.Name].Tester)then
newPlayer.PlayerGui.BetaBlock:Remove() --or this
newPlayer.PlayerGui.VIPBlock:Remove() --" "
end;
function onPlayerEntered(newPlayer)
local GamePass=game:service'GamePassService';
local ID1=222805421
local ID2=222807114
local function printf(String,...)
print(string.format(String,...));
end;
local Passes={
Tester=GamePass:PlayerHasPass(newPlayer,ID1) and true;
VIP=GamePass:PlayerHasPass(newPlayer,ID2) and true;
};
if(next(Passes))then--// If player has any pass.
for Pass in next,Passes do
printf('Player %s has the %q pass.',
newPlayer.Name,
Pass
);
end;
else
printf('Player %s is a visitor.',newPlayer.Name);
newPlayer.PlayerGui.VIPBlock:Remove() --this was my attempt at functioning with a player that has no pass
wait(30)
newPlayer:Kick()
end
PassRank[newPlayer.Name]=Passes;
assertPlayer(newPlayer);
end;
game:service'Players'.PlayerAdded:connect(onPlayerEntered)

3 comments
Please explain a bit more about your problem...
OOPS, I FAILED XD!!! Just change PassSettngs to PassRank, I had renamed the table. Sorry.
I edited my answer, check it again.