In the roblox tutorials, you have the option to make a dialog shop. The only thing is, In the tutorial they only show you how to add items your character uses to your backpack; so like a sword. I however want to make it sell cars.
Tutorial script.
local dialog = script.Parent dialog.DialogChoiceSelected:connect(function(player, choice) -- Check the player has a stats object local stats = player:FindFirstChild('leaderstats') if not stats then return end -- And that the stats object contains a gold member local gold = stats:FindFirstChild('Gold') if not gold then return end if choice == script.Parent.DialogChoice.ChoiceA then if gold.Value >= 5 then -- 5 is the amount of gold you need to purchase this weapon game.ReplicatedStorage.Weapon1:Clone().Parent = player.Backpack gold.Value = gold.Value - 5 -- subtract the amount of gold you need to purchase end elseif choice == dialog.DialogChoice.ChoiceB then if gold.Value >= 10 then game.ReplicatedStorage.Weapon2:Clone().Parent = player.Backpack gold.Value = gold.Value - 10 end elseif choice == dialog.DialogChoice.ChoiceC then if gold.Value >= 15 then game.ReplicatedStorage.Weapon3:Clone().Parent = player.Backpack gold.Value = gold.Value - 15 end end end)
I attempted to modify this...
local dialog = script.Parent dialog.DialogChoiceSelected:connect(function(player, choice) -- Check the player has a stats object local stats = player:FindFirstChild('leaderstats') if not stats then return end -- If not end script -- And that the stats object contains a money member local money = stats:FindFirstChild('Money') if not money then return end if choice == script.Parent.DialogChoice.ChoiceA then if money.Value >= 5 then -- 5 is the amount of money you need to purchase this car game.ReplicatedStorage.Sportscarblue:Clone().Parent = game.Workspace money.Value = money.Value - 5 -- subtract the amount of money you need to purchase end end end)
Since I'm still grasping the understand of Cframes and teleportation... I put the car in replicated storage. I then moved the car that was in storage to be positioned over a pad that would be used for a car delivery point. Everything went fine, put when the car is actually spawned, It falls apart into all the parts used to build the model.
So, how can I get a dialog shop to sell a model while keeping the models integrity upon cloning/teleportation?
I think you need to weld all the parts of the car together. Try getting a Easy-Weld Plugin. highlight all the parts and weld them together. Welding holds everything together.
I'd also recommend trying to Anchor and Unanchor the car model.