of     1   

Dotheharlemsheikh
#185256703Sunday, March 13, 2016 3:47 PM GMT

Hello all, right now in my developing group game, im having some trouble scripting. I need to know how to transfer a weapon to the StarterPack when you click a Gui button.
supremebloxboy
#185265433Sunday, March 13, 2016 6:04 PM GMT

script.Parent.MouseButton1Down:connect(function() game.ServerStorage.WEAPON:clone().Parent = game.Players.LocalPlayer.StarterGear end) --Change WEAPON to the weapon name --Put the weapon in ServerStorage --This script must be in a localScript, Inside the Button
Dotheharlemsheikh
#185285964Sunday, March 13, 2016 10:48 PM GMT

thanks bro
CoyoteStark
#185288974Sunday, March 13, 2016 11:37 PM GMT

That won't work, as local scripts can't access ServerStorage, use ReplicatedStorage instead.
Dotheharlemsheikh
#185289654Sunday, March 13, 2016 11:47 PM GMT

figured that out the hard way
Dotheharlemsheikh
#185289992Sunday, March 13, 2016 11:53 PM GMT

doesnt work either, but it works in studio mode
Dotheharlemsheikh
#185295325Monday, March 14, 2016 1:17 AM GMT

I FOUND A SOLUTION: script.Parent.MouseButton1Down:connect(function() game.ReplicatedFirst.WEAPON:clone().Parent = game.Players.LocalPlayer.Backpack end) --Change WEAPON to the weapon name --Put the weapon in ReplicatedFirst --This script must be in a localScript, Inside the Button. I tested it, and somehow it worked. Thank you all for helping.

    of     1