Hi Scrippters, I’m trying to make a system that makes players invisible by level
eg Player1 is at level 5 and Player2 is also at level 5, so they can see each other normally, but now Player2 Raises to level 6, now they can’t be seen
And if someone knows how to do this system on the server side, it would be much better, thanks in advance
Level:GetPropertyChangedSignal(“Value”):Connect(function()
for i, v in pairs(game.Players:GetPlayers()) do
if v.Level.Value ~= Level.Value then
local char = v.Character
for i, v in pairs(char:GetChildren()) do
v.Transparency = 1
end
end
end
end)
This won’t let you see others again if they reach your level and they will be visible if they reset but it’s a start.
Also you will need localscripts so each player can see themselves.
Sadly this system can’t be done on the server side as you need the client to make players invisible only to them.
Like @Redluo pointed out in his code, you can just check the players level against the players own level and make their parts invisible. I would recommend having the checks on the server side and just firing it over to a player when it changes. You can either fire all players when someone’s level changes and have every player check their level against the player’s level that changed, or on the server make a function to handle it and tell which players who they can and can’t see and just have the script make them invisible.
You should also check that the part you are trying to change .Transparency of :IsA("BasePart") so that it actually has the .Transparency property and won’t break your code.
I think that you could use the Level property of Userdata/Player. Level:GetPropertyChangedSignal(“Value”):Connect(function()
for i, v in pairs(game.Players:GetPlayers()) do
if v.Level.Value ~= Level.Value then
local char = v.Character
for i, v in pairs(char:GetChildren()) do
v.Transparency = 1
end
end
end
end)