Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:12 PM |
| Hello how do i make a script that will only give the owner of the game a item and no one else gets that item only the owner how would i do this? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2017 05:15 PM |
| When does this happen? When the owner enters the game? |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:16 PM |
| Yes when the owner enters the game |
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 23 Jul 2017 05:22 PM |
game.Players.PlayerAdded:Connect(function (player) player.CharacterAdded:Connect(function (character) if game.CreatorId == player.UserId then --Code end end) end) |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2017 05:26 PM |
thetool = game:GetService("ServerStorage")["TOOL NAME HERE"]
game.Players.PlayerAdded:Connect(function(p) if p.UserId == USER_ID_HERE then local bp = p:WaitForChild("BackPack") thetool : Clone( ). Parent = bp -- remove spaces here, tags end end) |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:26 PM |
| Please explain more im not really understanding where to put what. |
|
|
| Report Abuse |
|
|
LeafDoode
|
  |
| Joined: 29 May 2017 |
| Total Posts: 3094 |
|
|
| 23 Jul 2017 05:32 PM |
local tool = game:GetService("ServerStorage"):WaitForChild("tool name here")
so put the tool you want in a service located in the explorer called "ServerStorage"
now make a normal script and put it in workspace and type the following:
game.Players.PlayerAdded:connect(function(plr) if plr.UserId == game.CreatorId then tool:Clone().Parent = plr.Backpack end end) |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:34 PM |
| Is this for R15 its not working ill try to fix it |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2017 05:34 PM |
| ^ That should all be in one script. |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:38 PM |
To all who helped me sorry if im wasting your time im not the best at scripting and needed some help
thank you |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:40 PM |
| ok but its not working it wont show up in my backpack and nothing will show up in the output log any suggestions? |
|
|
| Report Abuse |
|
|
| |
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 05:49 PM |
ok
local tool = game:GetService("ServerStorage"):WaitForChild("HolyHandGrenade")
game.Players.PlayerAdded:connect(function(plr) if plr.UserId == game.CreatorId then tool:Clone().Parent = plr.Backpack end end)
|
|
|
| Report Abuse |
|
|
|
| 23 Jul 2017 05:57 PM |
local tool = game:GetService("ServerStorage"):WaitForChild("HolyHandGrenade") print("Tool found")
game.Players.PlayerAdded:connect(function(plr) print("Player added") if plr.UserId == game.CreatorId then print("Creator") local bp = plr:WaitForChild("Backpack") print("Cloning Tool") tool:Clone().Parent = bp end end)
Tell me what prints if it doesn't work. |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 06:01 PM |
it prints "Tool found Player added" |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2017 06:05 PM |
| Ok, I thought this might happen. Are you testing in Play Solo? If you are, you are playing as "Player1", who isn't the creator. |
|
|
| Report Abuse |
|
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
| |
|
Day_ZI
|
  |
| Joined: 26 Feb 2017 |
| Total Posts: 69 |
|
|
| 23 Jul 2017 06:10 PM |
| :D YES FINALLY OK IT WORKED THANK YOU |
|
|
| Report Abuse |
|
|