generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Fairly easy 10 -12 line script help.

Previous Thread :: Next Thread 
TobiSpero is not online. TobiSpero
Joined: 24 Jun 2017
Total Posts: 74
29 Aug 2017 09:56 AM
So I have a tool in lighting.
I want the username "TobiSpero" to recieve this tool when he enters the game.
But ONLY him.
Can anyone help me?
I know you'd like CLONE that tool into backpack and startertool for that player but I'm bad at scripting e.e
Please help. Thanks.
Report Abuse
TobiSpero is not online. TobiSpero
Joined: 24 Jun 2017
Total Posts: 74
29 Aug 2017 10:02 AM
Bump, please help.
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
29 Aug 2017 10:03 AM
game.Players.PlayerAdded:connect(function(plr)
if plr.Name == "TobiSpero" then
local clo = game.Lighting.TOOLNAMEHERE:Clone()
clo.Parent = plr.Backpack
end
end)


Report Abuse
TobiSpero is not online. TobiSpero
Joined: 24 Jun 2017
Total Posts: 74
29 Aug 2017 10:04 AM
Thanks mate.
Report Abuse
TobiSpero is not online. TobiSpero
Joined: 24 Jun 2017
Total Posts: 74
29 Aug 2017 10:20 AM
Wait it didn't work.

Backpack is not a valid member of Player
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
29 Aug 2017 10:29 AM
then u set it up wrong, i tested it and it works fine


Report Abuse
WXBZ is not online. WXBZ
Joined: 10 Oct 2012
Total Posts: 850
29 Aug 2017 10:36 AM
@Luminak is this 2012 using lighting for storage?

Put the tool in the storage and use this script.

local toolPath = game.ServerStorage.Tool -- Put your tool in server storage and name it tool or just change this line.

local allowed = {
-- Roblox censored your UserID, just put it here and it will work.
};

local function allowedTool(id)
for _, plr in pairs(allowed) do
if (plr == id) then return true; end;
end;
return false;
end;

game.Players.PlayerAdded:Connect(function(player)
if (allowedTool(player.UserId)) then
local newTool = toolPath:Clone();
newTool.Parent = player.StarterGear; -- Better way of doing it but roblox censored it lol.
end;
end;


#code print("skrt")
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image