HTTP Service - Executing pstebin scripts

I have been making a thing where you can execute scripts in a roblox game (Script Builder), it works perfectly and all, but now I am trying to make it so you can get links from pstebin. It keeps coming up with "HTTP 404 (Not Found)

error:
https://gyazo.com/a7682f4d2cc58dfe51741f92a8419a1d

server side script:
https://gyazo.com/42532990bfad589ad2fa27998c2d2cc1

local script:
https://gyazo.com/a34403b9a15aa16847b1946e19232393

I’ve tried looking on the dev forum and I can’t find anything that helps.

For now I am attempting to print the pstebin script, later I will make it execute it if I figure out how to even print it.

Any help would be appreciated. :smiley:

You could just do, loadstring(game:GetService("HttpService"):GetAsync("pastebin.com/raw/00000")). And the error says that or the pastebin link is incorrect or its just not valid.

At the end you put pastebin.com/raw/00000
What does the “00000” bit mean?

Show us an example of you using this

1 Like

https://gyazo.com/1019ddfc846acde7b139d011f7b21506

There is also no need to url encode the data from the client on the server script

1 Like

But I want the user to be able to use any pastebin they have made. Unless you mean I don’t event need the client script?

You do not need to url encode, because when url encoding it will add a bunch of escape tags

1 Like

So I just do this:
https://gyazo.com/c9ef951c53070d9e6af27f896d136e0c
?

Be careful when making something like this. Since it’s on the server, anyone can do something malicious. I would recommend a whitelist system where players can only execute scripts that you verify the safety of yourself.

Yeah it should work, and the zeros we’re for the example since I didn’t have any pastebin link to put in.

I know what you mean, but I still can’t get it to work. I just keep getting this error.
https://gyazo.com/2fa134f2bb5d04ed4bfde8a662118c21

Okay, well with both ways I had no issue, the possibility is that you gave a bad url

1 Like

Did I completely write my script wrong or is the pastebin link just bad or something?

The possibility of spaces in the data being sent can also factor into this

1 Like

Is it okay if you show me your script? So I can compare ours and hopefully find a mistake in mine.

I think you forgot the first argument of OnServerEvent. It should be playerWhoFired, Text instead of just Text .

remoteEvent.OnServerEvent:Connect(function(player, text)

end)

Player is always passed automatically to OnServerEvent.

-- Code on the server as an example
warn("Without a URL Encode")
print("http://pastebin.com/raw/wiMpx51T")
local l = game.HttpService:GetAsync("http://pastebin.com/raw/wiMpx51T");
print(l)


warn("With a URL encode")
print("pastebin.com/raw/"..game.HttpService:UrlEncode("wiMpx51T"))
l = game.HttpService:GetAsync("http://pastebin.com/raw/"..game.HttpService:UrlEncode("wiMpx51T"));
print(l)

Output:
image

1 Like

Thanks, I know the problem now. It was that I just put “Text” Instead of “playerWhoFired, Text”. Thanks to everyone who helped. :slight_smile:

1 Like