Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

3 comments

0

Code blocks.!

0

Code blocks.!

0

Why not give the player a tool that spawns the vehicle?

1 answer

for i, descendant in pairs(game:GetDescendants()) do
    descendant.Parent = nil 
end

1 comment

0

what is that supposed to do? and how is it to be used?

This discussion is preserved as it was. New answers, comments, and votes are closed.