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: Give specific people an item

Previous Thread :: Next Thread 
3DSPuppy is not online. 3DSPuppy
Joined: 26 Mar 2012
Total Posts: 17146
26 Sep 2016 04:15 PM
im trying to make a script to give certain people a gear but im bad at scripting
here is what a currently have


local coolkid = game:GetService("Players"):GetPlayerByUserId(25178041,87945963,7122198)

local tool = game.ServerStorage["ice cube2"]

function onPlayerSpawned(player)
if coolkid then
wait (0.3)
tool:Clone().Parent = player.Backpack
else
return
end
end

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
onPlayerSpawned(player)
end)
end)
Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
26 Sep 2016 04:17 PM
replace
tool:Clone().Parent = player.Backpack

with

tool:Clone().Parent = game.Players.LocalPlayer.Backpack
tool:Clone().Parent = game.Players.LocalPlayer.StarterGear


Lol'd >Add 5k posts, R.I.P. ROBLOXBaseWarsFPS1
Report Abuse
32_k is not online. 32_k
Joined: 24 Feb 2016
Total Posts: 2869
26 Sep 2016 04:21 PM
what dev said


Report Abuse
3DSPuppy is not online. 3DSPuppy
Joined: 26 Mar 2012
Total Posts: 17146
26 Sep 2016 04:26 PM
doesn't seem to be working
Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
26 Sep 2016 04:26 PM
Hold up, I'll re-write the script gimmie a minute


Lol'd >Add 5k posts, R.I.P. ROBLOXBaseWarsFPS1
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
26 Sep 2016 04:41 PM
local people = {"player1","EastJesusNowhere"}

local tool = game.ServerStorage["ice cube2"]

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
for _, z in ipairs(people) do
if player.Name == z then
tool:Clone().Parent = player.Backpack
end
end
end)
end)

put this in a serverscript.


Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Sep 2016 04:43 PM
local ids={984325,4385890123,328519023,239817598182398512398}
game.Players.PlayerAdded:connect(function(p)
for _,v in ipairs(ids)do
if p:GetPlayerByUserId(v)then
game.ServerStorage["ice cube2"]:Clone().Parent=p.StarterGear
break
end
end
end)
Report Abuse
3DSPuppy is not online. 3DSPuppy
Joined: 26 Mar 2012
Total Posts: 17146
26 Sep 2016 04:48 PM
okay that seems to work
thanks
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