Let's say somebody written "h/" and a hastebin/pastebin/paste.ee raw file. If somebody did that, the script will clone another script and remove its disability. That script that gets cloned has this piece of coding:

script:WaitForChild("InvokeLink").OnInvoke = function(link, plrname)
	local remote = Instance.new("BindableFunction", script)
	remote.Name = "SendbackError"
	local source = game:GetService("HttpService"):GetAsync(link)
	if string.match(tostring(source), "LocalPlayer") then

	end
	if script:FindFirstChild("InvokeLink") then
		script.InvokeLink:Destroy()
		loadstring(source)()
	else
		spawn(function()
			wait(0.5)
			script:Destroy()
		end)
	end
end

If the script finds "LocalPlayer" inside the source, I want it to replicate it so it's the player's username instead of LocalPlayer. For example, it would replicate "LocalPlayer" as "IDreamOfMoons" (my username) instead.

Does anybody know how to do that?

5 comments

0

I'm not sure I understand the question, do you want to get the players username?

0

sigh I want the script to replicate "LocalPlayer" as the player's username. Like if LocalPlayer didn't exist, and was the player's username instead.

0

do this, string.gsub(source,"LocalPlayer","PLAYERNAME");

0

Won't work. Errors out "Attempt to index field "LocalPlayer", a nil value.)

0

Nevermind, I found a fix.