Scripting Helpers is winding down operations and is now read-only. More info→
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 years 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.! User#19524 175 — 6y
0
Code blocks.! User#19524 175 — 6y
0
Why not give the player a tool that spawns the vehicle? Meltdown81 309 — 6y

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?

1 answer

Log in to vote
-1
Answered by 6 years 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 — 6y
Ad