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

How do i make a script that load text from pastebin?

How do i make a script that load text from pastebin? what i need help with was if the text in the textbox matches text from pastebin text trigger the script

1 answer

✓ Accepted answer

You can use HttpService:GetAsync(). Note that you must use it in a server script.

An example:

Server:

local url = "http://pastebin.com/raw/blabla"
local pastebinText = game:GetService("HttpService"):GetAsync(url, true) --the "true" as 2nd argument is to prevent it from caching the response, although I guess its not necessary here

local remoteFunc = Instance.new("RemoteFunction", game:GetService("ReplicatedStorage"))
remoteFunc.Name = "TextRemote"
remoteFunc.OnServerInvoke = function(plr, text)
	return text == pastebinText
end

Client:

local remoteFunc = game:GetService("ReplicatedStorage"):WaitForChild"TextRemote"
local textBox = script.Parent.TextBox
local textButton = script.Parent.TextButton

textButton.MouseButton1Click:Connect(function()
	local isValid = remoteFunc:InvokeServer(textBox.Text)
	print("The text is",isValid and "valid" or "invalid")
end)

3 comments

0

I was wondering about that too.

0

Thanks

0

Can you explain me more in discord?

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