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

How to make a tool/script admin only(Base on "if username=)? [closed]

Asked by 4 years ago

This is as similar as my last question, but instead of "if username= "script". So i recently i used a script based on "time stopping" from jojo. And i want to make them only me and my friend can use it, but I do not know how to make it so that only i can use it.. https://imgur.com/N7Dqac0

https://imgur.com/NTcdooQ

The ones that are highlighted with yellow are the "Time Stop" script/models i want to restrict them that only i can use it. And of course an answer is always appreciated.

Closed as Not Constructive by DinozCreates, CreationNation1, and Dovydas1118

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 4 years ago

Can you be more specific? You want the tool to be clone only for specific users? if it is then make a script in the serverscriptservice and then put the tool in ReplicatedStorage

local tool = game:GetService("ReplicatedStorage"). -- your item name
local Accessors = {"DONTGIMMEUSELESS", "otherusernameifyouwantot"}

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        for i=1, #Acessors do
            if Player.Name == i[Acessors] then
                local clone = tool:Clone()
                clone.Parent = Player:WaitForChild("Backpack")
                if Character.Humanoid.Health == 0 then -- if you die the tool will clone again
                    wait(4.75)
                    local clone = tool:Clone()
                    clone.Parent = Player:WaitForChild("Backpack")
                end
            end
        end
    end)
end)

I don't know if this is what you want, if it's not then please be more specific. Stay safe.

0
To be more specific, i want those that i highlighted in the image link only usable by me. DONTGIMMEUSELESS 1 — 4y
0
then use this script, but delete the "otherusernameifyouwantot" and delete the comma WINDOWS10XPRO 438 — 4y
0
It doesn't work.. my alt is still able to use the timestop. DONTGIMMEUSELESS 1 — 4y
0
Nvm, imma make another script. DONTGIMMEUSELESS 1 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local whitelist = { -- make a table of your profile IDs
    YourId,
    YourFriendsId
}

Players.PlayerAdded:Connect(function(player) -- detect when a player connected
    local UserId = player.UserId -- get the player's id
    if whitelist[UserId] then -- check if their id is in the whitelist
        --script here
    end
end)