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: I need help

Previous Thread :: Next Thread 
Day_ZI is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 05:15 PM
When does this happen? When the owner enters the game?
Report Abuse
Day_ZI is not online. 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 is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
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 is not online. 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 is not online. 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 is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 05:34 PM
^ That should all be in one script.
Report Abuse
Day_ZI is not online. 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 is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 05:45 PM
Post what you have.
Report Abuse
Day_ZI is not online. 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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
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 is not online. Day_ZI
Joined: 26 Feb 2017
Total Posts: 69
23 Jul 2017 06:01 PM
it prints "Tool found
Player added"
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
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 is not online. Day_ZI
Joined: 26 Feb 2017
Total Posts: 69
23 Jul 2017 06:06 PM
Ok
Report Abuse
Day_ZI is not online. 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
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