Hey Guys,
I currently Script on a coustom Dialog Shop System.
and I have a little Question: How can I clone an Item from the ServerStorage into the Players inventory?
Thats my Current Script:
script.Parent.MouseButton1Click:Connect(function() local Todo = script.Parent.Todo local plr = game.Players.LocalPlayer if Todo.Value == "Coke" then if plr.leaderstats.Cash.Value >= 100 then plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value - 100 end Todo.Value = "" script.Parent.BackgroundTransparency = 1 script.Parent.Text = "" script.Parent.Parent.Right.BackgroundTransparency = 1 script.Parent.Parent.Right.Text = "" script.Parent.Parent:TweenPosition(UDim2.new(-2,0,.419,0), "Out", "Quad",1) script.Parent.Parent.TextLabel.Text = "" workspace:FindFirstChild(script.Parent.Todo.NPC.Value).BillboardGui.debounce.Value = false end end)
Thanks for help :D
If you want to clone something you use :Clone() also, if you're planning on cloning something from the serverstorage make sure to use a global script because local scripts can't access serverstorage. In your case I'd use a variable that will be the item you want to clone and you'd clone it and then parent it to the backpack of the player. S = game.ServerStorage:WaitForChild("YourItem"):Clone() S.Parent = Player.Backpack