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: yo script help

Previous Thread :: Next Thread 
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:22 AM
I know how to get things added in my inventory in game when I spawn and no one else, how do I do it for other people?
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 06:22 AM
Put stuff in StarterPack.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:23 AM
Yea I know that, but I want it for just 1 person not everyone.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:27 AM
B1
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:29 AM
B2
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:52 AM
All I need is to add something in my friends inventory. I know how to do mine, but I don't have the script for theirs
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 06:52 AM
Okay, put your tool somewhere (I personally like to put it in ServerStorage, your choice though)

change local tool to the path of the tool (e.g. game.ServerStorage.MyTool)::
and change local vip to "the name of the player you want to give the tool to" (e.g. "SinisterDoggy")::

local tool =
local vip = ""
game.Players.PlayerAdded:connect(function(ply)
if ply.Name == vip then
t = tool:Clone()
t.Parent = ply.Backpack -- This might not be "Backpack". Double check this.
end
end

That SHOULD do it. Just play around with it. This wasn't done in Studio so I'm not sure if I've made a mistake

PM me if you need any help.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:54 AM
For MyTool, would that be the name of the tool?
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 06:56 AM
Yep. So if the name of your tool was 'Knife' then change it to

game.ServerStorage.Knife

or where ever it's stored.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 06:58 AM
Do I keep Local Tool?
Or delete that and add
game.SeverStorage.(tool)
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:00 AM
Right now I have
local tool = game.ServerStorage(tool name)
local vip = "SinisterDoggyAlt"
game.Players.PlayerAdded:connect(function(ply)
if ply.Name == vip then
t = tool:Clone()
t.Parent = ply.Backpack -- This might not be "Backpack". Double check this.
end
end

And SinisterDoggyAlt is my testing account, and I didn't get it.
Is there anything I should change?
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 07:05 AM
local tool = game.ServerStorage(tool name)

1. Have you actually put your tool name there or just put (tool name)?

2. Have you put your tool in ServerStorage?
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:07 AM
Yes, I put the tool name in there
And yes it's in server storage, cause that's what I did for mine
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:07 AM
Like, I put Darkheart in there since that's the name of it
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:09 AM
So basically I have
local tool = game.ServerStorage.Darkheart
local vip = "SinisterDoggyAlt"
game.Players.PlayerAdded:connect(function(ply)
if ply.Name == vip then
t = tool:Clone()
t.Parent = ply.Backpack -- This might not be "Backpack". Double check this.
end
end
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 07:10 AM
Just give me a second to jump on studio and try this
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:11 AM
Alright
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 07:16 AM
Okay, this worked. I missed a ) and It was creating it too fast so I made sure it waited for the players backpack to be created:

local tool = game.ServerStorage.Tool
local vip = "Player"
game.Players.PlayerAdded:connect(function(ply)
if ply.Name == vip then
t = tool:Clone()
ply:WaitForChild("Backpack")
t.Parent = ply.Backpack -- This might not be "Backpack". Double check this.
end
end)
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
30 Jan 2015 07:21 AM
was too lazy to put possibility for more tools than one to give (ok i cant say it would have been too easy for me)
capitalization shouldnt matter
put player's name inside list table and tool's name as value, the same way as it is

storage = game.ServerStorage -- where the tools are in

list = {
["someguy"] = "Darkheart",
["plAyer1"] = "Tool"
}

function intable(st)
for p,i in pairs(list) do
if p:lower() == st:lower() then
return true
end
end
return false
end

function gettool(st)
for p,i in pairs(list) do
if p:lower() == st:lower() and storage:FindFirstChild(i) then
return storage[i]
end
end
return nil
end

game.Players.PlayerAdded:connect(function(plr)
if intable(plr.Name) then
local tool = gettool(plr.Name)
if tool then
tool:clone().Parent = plr:WaitForChild("Backpack")
tool:clone().Parent = plr:WaitForChild("StarterGear")
end
end
end)
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:24 AM
What do I do with Player1 and someguy?
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
30 Jan 2015 07:25 AM
they were just example names
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:30 AM
SO where do I put the player name of the person i'm going to give the tool to?
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:31 AM
*So
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
30 Jan 2015 07:32 AM
["PLAYERNAME"] = "TOOLNAME"
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
30 Jan 2015 07:38 AM
can you put the exact script down
the name would be SinisterDoggyAlt
and tool name will be Darkheart
Can you add in the name and darkheart in?
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