Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Check For Changes In A Raw Paste?

Asked by 3 years ago

I'm trying to retrieve data from a pastebin I made, and I want it to constantly check if the contents of the paste changes and if it does print out the contents once!

while wait() do
    print(game:HttpGet('https://pastebin.com/raw/rBZ3eV3v')) -- only print if the contents inside the paste changes.
end

1 answer

Log in to vote
0
Answered by 3 years ago

Try repeatedly changing a stringvalue, then waiting for that string value to change using a .Changed event. This may cause lag, however. (Not sure)

local stringvalue = Instance.new("StringValue")
delay(.1,function()
    while wait() do
        stringvalue.Value = game:GetService("HttpService"):GetAsync('https://pastebin.com/raw/rBZ3eV3v')
    end
end)
stringvalue.Changed:Connect(function(newValue)
    print(newValue)
end)

-- below is a test
wait(3)

stringvalue.Value = "hello"
Ad

Answer this question