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
|
  |
| Joined: 24 Jun 2017 |
| Total Posts: 74 |
|
| |
|
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
|
  |
| Joined: 24 Jun 2017 |
| Total Posts: 74 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|