messages twice (for both values when they appear i guess) but doesn’t pick up any value changes.
local https = game:GetService("HttpService")
local url = no.
game.Players.PlayerAdded:Connect(function(plr)
local folder = plr:WaitForChild("leadstats")
local nights = folder.nights
local maxmode = folder.maxmode
local function senderror(plr)
warn("Actually connected lol")
local message = "Data change ".. plr.UserId.."/"..plr.Name.. " ".. "nights: "..nights.Value.. " maxmode: ".. tostring(maxmode.Value) --gets defined later so by the time the webhook sends it should be defined
local info = {
["embeds"] = {{
["title"] = "Data change",
["description"] = message
}}
}
local encrpyted = https:JSONEncode(info)
https:PostAsync(url, encrpyted)
end
for _, vals in pairs(folder:GetChildren()) do
warn("For loop happened")
vals.Changed:Connect(senderror(plr))
warn ("Connected")
end
end)