Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a script like no tools will be duplicated?

How to make a script like no tools will be duplicated on a player? Like if he have the tool "Building Tools" the player can't have another one if:

  • the player clicked on the tool giver or
  • the player was given by admin command

1 comment

0

have it check the player's backpack or starter pack and if it's there end the function, if it isn't continue the fiunction.

1 answer

✓ Accepted answer

You could add code into the giver script that checks if the player has the tool in this backpack and if not then give it too him.

local good = true
local tool = (tool am trying to give)
local player = (the player you got from the admin/give)
local tools = Player.Backpack:GetChildren ()
For i=1,#tools do
      If tools[i].Name == tool.Name then
              Good = false
       end
end
If good == true then
       --give tool
end

and if you have the character not the player you can get the player with the code:

local character = (character you got from script)
local player = game.Players:GetPlayerFromCharacter(character)

Hope that helps ;)

1 comment

0

You also need to check the player module too.

This discussion is preserved as it was. New answers, comments, and votes are closed.