Error: 21:46:16.290 - Bronze Sword is not a valid member of Model Attempts: I have been changing how to find the item Whats needed: I am wanting it to find the item thats the name of the TextLabel in the ServerStorage and clone it and put it in there backpack when they have enough Gold
function BuyItem(player) if script.Parent.TextButton.Text == 'BUY NOW!' then if script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Gold.Value >= script.Parent.ForBuyCost.Value then print("Has Money") local toolca = game.ReplicatedStorage.ITEMS(script.Parent.ObjName.Text):Clone() local toolcb = game.ReplicatedStorage.ITEMS(script.Parent.ObjName.Text):Clone() toolca.Parent = script.Parent.Parent.Parent.Parent.Backpack toolcb.Parent = script.Parent.Parent.Parent.Parent.StarterGear local bc = BrickColor.new("Bright red") game.StarterGui:SetCore("ChatMakeSystemMessage", { Text = "[SYSTEM] "..player.Name.." PURCHASED"..script.Parent.ObjName.Text; Font = Enum.Font.Cartoon; Color = bc.Color; FontSize = Enum.FontSize.Size96; }) end else print("PLAYER IS POOR") end end
Since this is GUI code, I assume you're using a LocalScript. ServerStorage is not replicated to Clients. Your best bet here is firing a RemoteEvent and having a server-sided Script give the Player their item.