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

Loadstring problems??? [Values]

I have no output or ypcall(function error...

Gravity_Cmd(1,'Execute command','Exe','Exection Script',function(Plr,Msg)
	local Run,Error=ypcall(function()
	    local val=Instance.new('StringValue',script)
	    val.Value=Msg
	    wait()
	    loadstring(val.Value)
	    delay(3,function()
	        val:remove()
	    end)
	end)
	if not Run then Output(20,Plr,'WARNING : '..Error,'Deep orange',function() end) end
end)

2 answers

✓ Accepted answer

The problem is you set up the loadstring function but never called it.

loadstring(val.Value) --Yours
loadstring(val.Value)() --Mine

Also there's no need to put it in a stringvalue.. so to fix;

Gravity_Cmd(1,'Execute command','Exe','Exection Script',function(Plr,Msg)
	local Run,Error=ypcall(function()
        	loadstring(Msg)()
	end)
	if not Run then 
		Output(20,Plr,'WARNING : '..Error,'Deep orange',function() end) 
	end
end)

1 comment

0

Im so stupid why didnt I think of that.. xD

If you mean the string isn't running than it's a pretty simple mistake that I often make as well:

loadstring(val.Value)()

1 comment

0

And I'm guessing you put it in a StringValue because it wasn't working before? You can just do "loadstring(Msg)()

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