Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it so it replicates LocalPlayer as the player's username instead?

Asked by 5 years ago
Edited 5 years ago

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?

0
I'm not sure I understand the question, do you want to get the players username? OkxieCorey 125 — 5y
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. IDreamOfMoons 0 — 5y
0
do this, string.gsub(source,"LocalPlayer","PLAYERNAME"); Troxure 87 — 5y
0
Won't work. Errors out "Attempt to index field "LocalPlayer", a nil value.) IDreamOfMoons 0 — 5y
0
Nevermind, I found a fix. IDreamOfMoons 0 — 5y

Answer this question