I’m making a simple script for a dev GUI that just gives a player a value based on their userID. It gives me an error saying "UserID is not a valid member of Player “Players.bellyfan1090”, my name is there since I pasted my userID as a test. What’s the issue here? I’m having a brain fart rn
script.Parent.MouseButton1Down:Connect(function()
local frame = script.Parent.Parent
local id = frame.UserID.Text
local amount = frame.Amount.Text
print("bruh")
for index, player in pairs (game.Players:GetPlayers()) do
if player.UserID == id then
print("check")
for index, leaderstats in pairs (player:GetChildren()) do
if leaderstats.Name == "leaderstats" then
print("check")
local playertime = leaderstats:FindFirstChild("Time")
playertime.Value = playertime.Value + amount
end
end
end
end
end)