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

Loadstring script not executing script?

It doesent run the script on the server for some reason also wondering if you can use loadstrings on client side

Server Script

game.ReplicatedStorage.server.OnServerEvent:Connect(function(plr,exe)
	loadstring(exe)
end)

Local Script

script.Parent.MouseButton1Click:Connect(function()
	local exe = script.Parent.Parent.Parent.script.TextBox
	if script.Parent.Parent.Parent.Parent.server.Value == false then
		loadstring(exe.Text)
	elseif script.Parent.Parent.Parent.Parent.server.Value == true then
			print("Player has gamepass")
			game.ReplicatedStorage.server:FireServer(exe.Text)
	else
		print("player dont got it :(")
	end
end)

2 comments

0

Is LoadStringEnabled set to true?

0

yeas

1 answer

✓ Accepted answer

The Problem

The problem with your server-side code is that the loadstring function returns a function

It looks something like this:

loadstring("CODE_IN_HERE")()

Applying

Now, we must apply this fact.

So in your server-side code, you would type:

game.ReplicatedStorage.server.OnServerEvent:Connect(function(plr,exe)
      loadstring(exe)()
end)

Some Problems (Not relevant to the solution)

.loadstring makes exploiting (or hacking) very easy to do; look for another system that can replace loadstring.

*.*Try adding some server-side checks to verify that the player is not exploiting. These are known as sever-sanity checks. (In your code) You can check if the server BoolValue is true or false on the Server since the Client can manipulate values

1 comment

0

Thank you, also im not very concerned about that since its an exploit gui

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