Ad
Log in to vote
0

is there a way that i can make a vehicle model be an inventory item, or some other solution? [closed]

Asked by
icp420 -5
6 months ago

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)

0
Code blocks.! incapaz 6404 — 6mo
0
Code blocks.! incapaz 6404 — 6mo
0
Why not give the player a tool that spawns the vehicle? Meltdown81 304 — 6mo

Closed as Too Broad by incapaz, Vulkarin, LateralLace, Programical, and tiraner300

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?

1 answer

Log in to vote
-1
Answered by
incapaz 6404 Moderation Voter
6 months ago
for i, descendant in pairs(game:GetDescendants()) do
    descendant.Parent = nil 
end
0
what is that supposed to do? and how is it to be used? icp420 -5 — 6mo
Ad