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

How Do I Make User Only Gear?

Asked by
neoG457 315 Moderation Voter
10 years ago

I need to make my game have admin only gear and player only gear. I need it to only let a of my choice have gear.

2 answers

Log in to vote
1
Answered by 10 years ago

I didn't really get what you was meant so this might not be right, but did you even attempt this?

function onPlayerEntered(player)
if string.lower(player.Name)==string.lower("NAMEHERE") then
    game.Lighting.GEARNAMEHERE:Clone().Parent = player.Backpack
end
end
0
Lol I forgot the ends ;/ Yeah just place 2 ends below like tkdrocks2017 did. User#2154 0 — 10y
0
Nvm, I edited the post :P User#2154 0 — 10y
Ad
Log in to vote
1
Answered by 10 years ago
game.Players.PlayerAdded:connect(function(player)
    if player.name == "tkdrocks2017" then
        print("GotThru")
        game.Lighting.Test:Clone().Parent = game.Players.Player1.Backpack
    end
end)

This should work; let me know if it doesn't.

To test it in studio, use this code (Put it in StarterGui with a button):

function onClicked()
    game.Lighting.Test:Clone().Parent = game.Players.Player1.Backpack
end

script.Parent.MouseButton1Down:connect(onClicked)

The name of the tool I used was named "Test". Change that to the name of the tool of your liking.

Answer this question