function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local c = Instance.new("IntValue")
c.Name = "Access Level"
c.Value = 1
c.Parent = stats
stats.Parent = newPlayer
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
I need this for my technology facility, where only certain ranks can enter certain areas.
