What do you want to achieve? Keep it simple and clear!
Get Rid of errors.
What is the issue? Include screenshots / videos if possible!
Attempt to call a nil with value = 275 line
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
nothing.
First Code:
function AddPlayer(Player)
if not game.ReplicatedStorage.Moderation.Players:FindFirstChild(Player.Name) then
local IntValue = Instance.new("IntValue")
IntValue.Name = Player.Name
IntValue.Value = Player.UserId
IntValue.Parent = game.ReplicatedStorage.Moderation.Players
end
end
Second Code:
game.Players.PlayerAdded:connect(function(Player) AddPlayer(Player) end)
for _, Player in pairs(game.Players:GetPlayers()) do
AddPlayer(Player) -- problem here
end