Roblox Loadstring Returning an Error

So, I am trying to create a Roblox plugin. This plugin creates a admin panel gui. As you may have guessed there are many scripts for the gui to make it work. Some scripts are very large, so I am am trying to use loadstring() instead of pasting the whole script onto one line.

However, there is a problem.
It is returning an error.

I have tried looking for solutions on the dev hub, and I have tried many things. None of them really worked.

Error code:

	local warnHandler = Instance.new("Script", game.ServerScriptService)
	warnHandler.Source = loadstring(http:GetAsync("https://pastebin.com/raw/G2xf3Jaj", true))()
	warnHandler.Name = "WarningsHandler"

loadstring returns a function when you call it, so the function it returns is not returning anything, therefore you are trying to set the Source to nil. Set the Source to the raw code instead:

warnHandler.Source = http:GetAsync("https://pastebin.com/raw/G2xf3Jaj", true)
1 Like

Thanks soooo much you have no idea how much you helped me. As a reward, I will give you the plugin for free on Roblox. Please send me a friend request so I can remember your username. Thanks again!