Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What's wrong with this 8-Line script?

link = "https://pastebin.com/raw/CU06Tjg4"
reason = "Updates."
while true do
    wait(1)
    if string.gsub(game.HttpService:GetAsync(link), " ", "") == "true" then
        for _, x in pairs(game.Players:GetPlayers()) do x:Kick(reason) end
    end
end

I use pastebin to shutdown servers, but sometimes it doesn't work. I made it print the text of the link in the output, and when it didn't work it printed: https://pastebin.com/raw/PgpqzQfn instead of true.

7 comments

0

That looks like HTML to me. Would you mind posting it on Pastebin?

1

Why are you doing hs:GetAsync("Shutdown for updates")? "Shutdown for updates is not a valid link

0

you can shut down the server from the games page surely ?

0
0

@programmerHere I had it also checking a pastebin link for the reason, but decided not to and forgot to remove that part. I fixed it but im still having my original problem

0

@royaltoe, Ok, but now that this is not working I'm curious as to why

0

Your pastebin of the HTTP response shows that pastebin rejected your attempt to fetch the page, CloudFlare (an anti-DDoS provider Pastebin uses) blocked it. This system is never going to work reliably unless you set up your own webserver. But now MessageService is a thing, you should probably just use that if you need more control than using Shutdown All Servers from your game page.

1 answer

✓ Accepted answer

Hello, you should probably use string.find().

link = "https://pastebin.com/raw/CU06Tjg4"
reason = "Updates."
while true do
    wait(1)
    if string.find(game.HttpService:GetAsync(link), "true") then
        for _, x in pairs(game.Players:GetPlayers()) do x:Kick(reason) end
    end
end

Please upvote if this works, Thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.