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

How wold i make a brick/model that only an admin can see?

Asked by 4 years ago

How would I make a brick/model that only an admin can see? Something like admin rules?

1 answer

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

Use localscript with a form of whitelist, whether that will be in a regular script (needs understanding of server to client communication) or local script.

Here's an example, I used a regular script under game:GetService'ServerScriptService' just so exploiters won't be able to see the code in the regular script (hopefully)

Regular script under game:GetService'ServerScriptService'

local RF=Instance.new('RemoteFunction',game:GetService'ReplicatedStorage');
RF.Name='RF1'
local a=Instance.new('Part',workspace)
a.Name='Wow_FE';

local list={'chloe_price65'};

RF.OnServerInvoke=function(plr)
    return(table.find(list,plr.Name) and true)or false
end;

Local script

local RF=local RF=game:GetService'ReplicatedStorage':WaitForChild'RF1';
if not RF:InvokeServer()then
    print'wow you aint chloe'
    local a=workspace:WaitForChild'Wow_FE'
    a:Destroy();-- this will only destroy the part in the client but still exists in the server
else
    print'wow hi chloe'
end;
0
woah big brain jordy2co 0 — 4y
Ad

Answer this question