Loadstring is returning nil

I am trying to set a global variable through github and load it into my game through a loadstring.

this is the code on the github

correctkey = 'HDcfE'

and this is my script in my game

loadstring("I cant put the link or roblox deletes it")


while true do 
	wait(1)
script.Parent.Text = correctkey
end

It ends up erroring Unable to assign property Text. string expected, got nil

I’m not sure why you are using a loadstring but you should use an http service. loadstring can compile a string into a code part. For example: loadstring(“print(“hi”)”)
Get a raw link out of github and use HttpService:GetAsync(link)

1 Like

loadstring returns a function you’ll need to also call that function so:

loadstring("[link]")()
loadstring(game:GetService("HttpService"):GetAsync("replace me with github URL"))()