How to make a buy model script work?
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:
03 | model = script.Parent.Parent.Parent.Tesla |
07 | upgradeStuff = model:clone(Upgrader 1 ) |
14 | function onTouched(hit) |
17 | check = hit.Parent:FindFirstChild( "Humanoid" ) |
20 | local user = game.Players:GetPlayerFromCharacter(hit.Parent) |
21 | local stats = user:findFirstChild( "leaderstats" ) |
24 | local cash = stats:findFirstChild( "Money" ) |
25 | if cash.Value > (Upgradecost- 1 ) then |
27 | cash.Value = cash.Value - Upgradecost |
28 | upgradeStuff.Parent = script.Parent.Parent.Parent |
29 | script.Parent.Parent:remove() |
39 | script.Parent.Touched:connect(onTouched) |
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