Here you go, let me know if it works.
** Edit :
I noticed I had cash instead of Cash - Fixed **
01 | model = script.Parent.Parent.Model |
03 | blarg = script.Parent.Parent.Name |
07 | Owner = script.Parent.Parent.Parent.Owner |
09 | function onTouched(hit) |
12 | check = hit.Parent:FindFirstChild( "Humanoid" ) |
14 | if hit.Parent.Name = = Owner.Value then |
16 | guy = game.Players:GetPlayerFromCharacter(hit.Parent) |
17 | local cash = Workspace.Cash [ guy.Name ] |
19 | if cash.Value > (price- 1 ) then |
20 | cash.Value = cash.Value-price |
21 | copy.Parent = script.Parent.Parent |
23 | script.Parent.Parent.Humanoid:Destroy() |
24 | script.Parent:Destroy() |
25 | elseif cash.Value < (price- 1 ) then |
26 | script.Parent.Parent.Name = ( "You still need $" ..(price-cash.Value).. " to purchase this." ) |
28 | script.Parent.Parent.Name = blarg |
36 | script.Parent.Touched:connect(onTouched) |