You’re using MouseButton1Click on the server, when it’s client side only. loadstring() is server side only, and so is the HttpService. Use a RemoteEvent and use the RemoteEvent.OnServerEvent event to use the service.
local button = script.Parent
local textBox = button.Parent.TextBox
button.MouseButton1Click:Connect(function()
game.Workspace.RemoteEvent:FireServer(textBox.Text)
end)
Now the server side remote event.
local remote = game.Workspace.RemoteEvent
remote.OnServerEvent:Connect(function(plr, url)
local HttpService = game:GetService"HttpService"
pcall(function()
local theURL = HttpService:GetAsync(url, true)
if theURL then
loadstring(theURL)
else
error(theURL)
end
end)
end)
2 comments
LocalScripts can’t use loadstring.
im not useing a local script