Okay so I have been trying to make this car model I have made work as a buy able model to get for real money. The car is called the Tesla, my only problem is when I buy the model it spawns broken and out of shape. please help. Here is the script:
-------------------------------------------------------------------------------------------------------------------------
model = script.Parent.Parent.Parent.Tesla --Item name
Upgradecost = 1000 --Change cost to upgrade
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone(Upgrader1)--
model:remove() --remove the ingame model. We saved a clone for later.
local ting = 0 --debouncer
function onTouched(hit)
if ting == 0 then --check for debounce
ting = 1 --activate debounce
check = hit.Parent:FindFirstChild("Humanoid") --try to find the human that touched the button
if check ~= nil then --if toucher is a human then to following
local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder
if stats ~= nil then --If moneyholder exists then
local cash = stats:findFirstChild("Money") --Get money
if cash.Value > (Upgradecost-1) then --If there is enough money then
cash.Value = cash.Value - Upgradecost --remove cash
upgradeStuff.Parent = script.Parent.Parent.Parent --put the upgrade into the game
script.Parent.Parent:remove() -- remove the upgrade button (in case of one-upgrade only)
end
end
end
ting = 0 --remove debounce
end
end
script.Parent.Touched:connect(onTouched) --start checking for touchers
Here are the links for proof:
C:\Users\Solrac\Documents\ROBLOX\Game Stuff\Astura with buy model button at start.png
C:\Users\Solrac\Documents\ROBLOX\Game Stuff\Astura afterwards (after bought using money).PNG

2 comments
Okay I think it was because I forgot to weld the car parts ( I only grouped them ) well thanks anyway and I will accept both answers
No wait I did have to add a function to my script, anyway thanks it works now :)