i am trying to make a vehicle shop gui i currently have a full currency system, the physical gui, and vehicle models, i looked for help with scripting on the gui and got a rough guide resulting in this script placed as a child of the text button on the gui. script.parent.mousebutton1click:connect(function() local RS=game.getservice("ReplicatedStorage") local item= RS:WaitForChild("left") local price=100 local player=game.players.localplayer local stats=player:waitforchild("leaderstats")
if stats.money.value>=price then stats.money.value= stats.money.value-price local cloned=item.Clone() cloned.parent=player.backpack end end)
the problem is that the vehicles cannot be placed in player.backpack, what do i need to do?
this is the currency script for reference.
game.Players.PlayerAdded:connect(function(p) local stats = Instance.new("IntValue", p) stats.Name = "leaderstats" local money = Instance.new("IntValue", stats) money.Name = "money" money.Value = 0 while true do wait(300) money.Value = money.Value + 100 end end)
for i, descendant in pairs(game:GetDescendants()) do descendant.Parent = nil end
Closed as Too Broad by User#19524, Vulkarin, LateralLace, Programical, and Le_Teapots
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?