I am trying to make a button on a Gui (It's a LocalScript) that will clone an item from ReplicatedStorage into their inventory.
PlayerDataCreator:
local SS = game:GetService('ServerStorage')
local data = Instance.new('Folder', SS)
data.Name = 'PlayerData'
game.Players.PlayerAdded:connect(function(plr)
local player = Instance.new('Folder', data)
player.Name = plr.Name
local Inventory = Instance.new('Folder', player)
Inventory.Name = 'Inventory'
end)
Item Clone Gui Script:
wait(1)
local item = game.ReplicatedStorage.Items:WaitForChild('Drop1')
local Player = game.Players.LocalPlayer
function onClicked()
item:Clone().Parent = game.ServerStorage.PlayerData.Player.Name.Inventory
end
script.Parent.MouseButton1Click:connect(onClicked)

1 comment
Oh, ok I see now! Thanks dude, mind if I message you on ROBLOX for any more help in future?