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

How can I change ReplicatedStorage name randomly in loop?

Asked by 3 years ago

To prevent some exploiters, I know you can change ReplicatedStorage name to random letters in a loop so players cannot change things from it. I have done this with workspace by doing:

function RandomVariable(f)
        local g = ""
        for h = 1, f do
            g = g .. string.char(math.random(97, 122))
        end
        return g
end

while true do
    wait(0.25)
    workspace.Name = RandomVariable(10)
end

And it works, but not for ReplicatedStorage.

game.ReplicatedStorage.Name = RandomVariable(10)

It doesn't work because it will not be named ReplicatedStorage anymore, so it will change it only one time. Can somebody please help if you know a way to do this?

0
You can get any service regardless of namechanges simply by doing game:GetService(). This is a waste of time, if you're trying to hide assets, don't, because you can't unless you don't intend on using them. radiant_Light203 1166 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Lol, you can always have a variable denoting ReplicatedStorage.

function RandomVariable(f)
        local g = ""
        for h = 1, f do
            g = g .. string.char(math.random(97, 122))
        end
        return g
end

while true do
    wait(0.25)
    workspace.Name = RandomVariable(10)
end

This works because workspace itself is the workspace, like a variable

local Rep = game.ReplicatedStorage -- now that we have this, let's put it into action
function RandomVariable(f)
        local g = ""
        for h = 1, f do
            g = g .. string.char(math.random(97, 122))
        end
        return g
end

while true do
    wait(0.25)
    Rep.Name = RandomVariable(10)
end

Being honest, this code is heavily useless, first of all, if the exploiter has access to the dex, they can simply bypass it by doing this:

local Rep = game.ReplicatedStorage
function RandomVariable(f)
    local g = ""
    for h = 1, f do
        g = g .. string.char(math.random(97, 122))
    end
    return g
end
spawn(function() -- lazy
    while true do
        wait(0.25)
        Rep.Name = RandomVariable(10)
    end
end)
wait(5)
print(game:GetService("ReplicatedStorage").Name)

Second, not many exploiters know what they are doing. Thus, this is a major waste of time. Result

Ad

Answer this question