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 » Scripting Helpers
Home Search
 

Re: Who will receive weapon

Previous Thread :: Next Thread 
kot100 is not online. kot100
Joined: 18 Sep 2010
Total Posts: 129
21 Jan 2014 04:15 AM
I want to add this scripted weapon to my game http://www.roblox.com/forum/showpost.aspx?postid=72239721
but when I add it to workspace, automatically first player that joins gets this weapon. So my question is, can someone modify this script to set who receives this weapon, please?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
21 Jan 2014 04:21 AM
game.Players.PlayerAdded:connect(function(plr)
local ToolName = ToolNameHere
local PlrName = PlayerNameHere
if plr.Name == PlrName then
game.Lighting.ToolName:Clone().Parent = plr.Backpack
end end)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
21 Jan 2014 04:21 AM
I didn't even look at the script, to tired, here's a new one.
Report Abuse
Immortalibus is not online. Immortalibus
Joined: 23 Oct 2013
Total Posts: 6421
21 Jan 2014 04:49 AM
Its a local script, so only you would get the item.
Report Abuse
kot100 is not online. kot100
Joined: 18 Sep 2010
Total Posts: 129
21 Jan 2014 05:11 AM
How do I use this? game.Players.PlayerAdded:connect(function(plr)
local ToolName = ToolNameHere
local PlrName = PlayerNameHere
if plr.Name == PlrName then
game.Lighting.ToolName:Clone().Parent = plr.Backpack
end end)
Do I have to add it at end of the knife script
or add another script inside knife script and paste it here?

@Immortalibus
Mostly I want to prevent people to get this weapon when they spawn so I can get something like admin weapon.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
21 Jan 2014 05:27 AM
Nevermind. The knife script is a scripted tool, unless you want to go through all of that code to find the one spot where it says 'script.Parent = ...' and change '...' to game.Lighting then sorry.
Report Abuse
kot100 is not online. kot100
Joined: 18 Sep 2010
Total Posts: 129
21 Jan 2014 05:40 AM
Changed it to game.Lighting and when I join my game I don't get any knife, in test mode it works, also I want to make it don't disappear from my backpack when I die.
Report Abuse
kot100 is not online. kot100
Joined: 18 Sep 2010
Total Posts: 129
21 Jan 2014 06:43 AM
I did it with weapon giver, and made admin room with this giver, thanks for trying to help.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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