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 » Scripting Helpers
Home Search
 

Re: startergear not working ?

Previous Thread :: Next Thread 
Swoof is not online. Swoof
Joined: 13 Mar 2010
Total Posts: 16146
25 May 2014 01:08 PM
local BUY = game.ServerStorage.ShopItems[item]:clone()
BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear


this is just a segment of the script which doesn't seem to be working

any idea why?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
25 May 2014 01:11 PM
Make sure that if and where you defined item that it's a string;

item = Item
Wrong

item = "Item"
Right

Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
25 May 2014 01:12 PM
putting stuff in startergear wont make it appear to the player unless they respawn.

Report Abuse
Swoof is not online. Swoof
Joined: 13 Mar 2010
Total Posts: 16146
25 May 2014 01:12 PM
here is the full script
gives the player the item to their backpack fine
but the player does not respawn with it

a = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
function onClick()

item = "Wooden Bow"
price = 500

a:WaitForChild("leaderstats")
Cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Coins
if Cash.Value >= price and not a.Backpack:FindFirstChild(item) then
Cash.Value = Cash.Value - 1
local BUY = game.ServerStorage.ShopItems[item]:clone()
BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear
BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Backpack
BUY.Handle.Anchored = false

end
end

script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
Swoof is not online. Swoof
Joined: 13 Mar 2010
Total Posts: 16146
25 May 2014 01:13 PM
@ver

yes, I am giving the item to both startergear and backpack
but they still dont spawn with it
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
25 May 2014 01:13 PM
you need to clone it twice, place one clone is StarterGear and the other in Backpack

so like

a = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
function onClick()

item = "Wooden Bow"
price = 500

a:WaitForChild("leaderstats")
Cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Coins
if Cash.Value >= price and not a.Backpack:FindFirstChild(item) then
Cash.Value = Cash.Value - 1
local BUY = game.ServerStorage.ShopItems[item]:clone()
local clone = BUY:clone()
clone.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear
BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Backpack
BUY.Handle.Anchored = false

end
end

script.Parent.MouseButton1Click:connect(onClick)




Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
25 May 2014 01:14 PM
Nothing is wrong with that.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
25 May 2014 01:15 PM
it is, he's cloning it once, putting it in startergear - then putting it from startergear into backpack.

Report Abuse
Swoof is not online. Swoof
Joined: 13 Mar 2010
Total Posts: 16146
25 May 2014 01:16 PM
Yeah, tyvm fixed now

stupid mistake dont know how i missed that
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
25 May 2014 01:16 PM
Ohhhh haha didn't see that. Yeah..

game.ServerStorage[tool]:Clone().Parent = SterterGear
game.ServerStorage[tool]:Clone().Parent = Backpack
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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