Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do you clone an item from ServerStorage into the players backpack?

Asked by
0hwl 0
3 years ago

So recently i have been making a swordfight game and made a Shop GUI, But whenever the player dies, the weapon is removed and you have to repurchase the item. I spent a little while figuring out what i need to do, and i came to the idea to clone an item from ServerStorage into a specific players StarterGear folder; Can anyone help with this? Feel free to explain as if i'm 5

0
Where is your code that gives players an item when they buy it? Why cant you use the same code when they respawn? WizyTheNinja 834 — 3y

1 answer

Log in to vote
2
Answered by 3 years ago
local copy = youritem:Clone()
copy.Parent = player.StarterGear -- you need to define player in your script, I'll leave that up to you, but as it is GUI there should be no problem

This should work.

0
How would I assign a specific weapon to the youritem variable? my problem now is that i dont know how to pinpoint what weapon the user has bought. 0hwl 0 — 3y
0
well, just edit the shop script to clone the item into startergear and backpack at the same time SpeedyTV_1 88 — 3y
Ad

Answer this question