factory = game.Lighting
local ting = 0
Upgradecost = script.Parent.Parent.Value.Value
local shirt = "http://www.roblox.com/asset/?id=161319468"
function onTouched(hit)
	if ting == 0 then
		ting = 1
   		local h = hit.Parent:FindFirstChild("Humanoid")
		local stats = game.Players:GetPlayerFromCharacter(hit.Parent):FindFirstChild("leaderstats")
		if h ~= nil then
			if hit.Parent:FindFirstChild("Shirt Graphic") ~= nil then
				if hit.Parent:FindFirstChild("Shirt Graphic").Graphic == shirt then
					local cash = stats:FindFirstChild("Money")
					if cash.Value > (Upgradecost-1) then
						car = factory.Car1:Clone()
						car.Parent = game.Workspace
						car:MakeJoints()
						ting = 0
					end
				end
			end
		end		
	end
end
script.Parent.Touched:connect(onTouched)

is there a way i could change this script so that the players dont have to wear the VIP shirt to buy this car. so basically if they own this VIP shirt they dont have to wear it in the game to buy the car. please help me. Thank you!

5 comments

2

Use a gamepass if you want the car to cost, not a shirt graphic.

1

Use PlayerOwnsAsset of MarketplaceService

0

m39 is there an artical on roblox wiki about playerownasset?

0

ty i dont it. thank you @M39a9am3R