Is it possible for a server script to read another scripts code?

Basically, let’s say that we have a server script and a client script. And I want the server script to see if there is anything inside that client script with the word ‘Hello’ or anything honestly. How can a script view/scan for a word or type of function inside another script?

(Not a plugin btw)

local script1 = workspace.Script1 -- script

print(script1.Source)

oh like this

local script1 = workspace.Script1 -- script

if script1.Source:match("word") then
-- here
end

Impossible unless it’s a plugin script. I know your doing this for an anti cheat but unfortunately it won’t work cuz it’s locked to plugin scripts.

If you’re using plugins in studio then reading Script.Source is what you need.

In a live game Script.Source isn’t allowed to be read from so no.

you can ready the source of scripts in normal scripts. You can only write in scripts from plugins.~

oops im dumb i got them mixed up oops

Scripts don’t have access to another script source code(directly not like in ModuleScripts). The reply above which references script.Source can only be run by a plugin or the command bar, which means it can’t be used in live servers. Also trying to scan a local script for let’s say viruses from the server isn’t going to work either, because when an exploiter modifies their client(for example inserting UI) those changes won’t replicate to the server, unless for special occasions like character movement.

2 Likes

That’s a big oof, I’m attempting to create a system to prevent/delete possible teleport tools from an exploiter, though it’s not looking well as if they time it right and spam the teleport tool, then I cant do much.

I mean they can easily bypass it no matter what, your better off movement checks etc

Thus even if it works localscripts or tools don’t get replicated to server.

I do have a good movement check system, though someone demonstrated that they can still teleport if they spam their teleport tool twice within 0.5’s. I don’t believe I Can do much about that.

Well instead of checking their client you can check their movement on the server(by distance per given time). Then check if they have permission to teleport/have that tool on the server. If permission returns false on the server but they somehow managed to travel a large amount of distance, they’re probably exploiting.

My system checks every 0.5’s and calculates the amount of magnitude that is set for a 0.5 movement, which is accurate. Though they can bypass it like this:

The exploiter gets the tp tool and teleports with it, my system then returns their previous position, but they have a 0.5’s window to teleport anywhere they want before it calculates it all again, to prevent false positives.

Instead of calculating every 0.5 seconds, you can calculate every time their magnitude is greater than a threshold, which means they’re moving at a fast speed.