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)
The problem with your server-side code is that the loadstring
function returns a function
It looks something like this:
loadstring("CODE_IN_HERE")()
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)
.
loadstring
makes exploiting (or hacking) very easy to do; look for another system that can replaceloadstring
..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