@iMaXxV

Я создаю режим где есть Cash он нужен для покупки предметов как починить?

ошибка( Cash is not a valid member of Folder "Players.immaxxv4.leaderstats" - Server - Script)
сам скрипт:
if buttons then
	for i, v in pairs(buttons:GetChildren()) do
		spawn(function()
			if v:FindFirstChild("Button") then

				local newObject = purchasedItems:FindFirstChild(v.Object.Value)
				if newObject ~= nil then
					objects[newObject.Name] = newObject:Clone()
					newObject:Destroy()
				else
					v:Destroy()
				end
				
				if v:FindFirstChild("Dependency") then
					v.Button.Transparency = 1
					v.Button.CanCollide = false
					v.Button.BillboardGui.Enabled = false
					coroutine.resume(coroutine.create(function()
						if purchasedItems:WaitForChild(v.Dependency.Value) then
							v.Button.Transparency = 0
							v.Button.CanCollide = true
							v.Button.BillboardGui.Enabled = true
						end
					end))
				end

				v.Button.Touched:Connect(function(hit)
					local player = game.Players:GetPlayerFromCharacter(hit.Parent)
					if player then
						if values.OwnerValue.Value == player then
							if v.Button.CanCollide == true then
								if player:FindFirstChild("leaderstats").Cash.Value >= v.Price.Value then
									player.leaderstats.Cash.Value -= v.Price.Value
									objects[v.Object.Value].Parent = purchasedItems
									v:Destroy()
								end
							end
						end
					end
				end)
			end
			tycoon.PurchasedItems.ChildAdded:Connect(function(add)
				animateBuildingIn(purchasedItems:FindFirstChild(v.Object.Value), TweenInfo.new(1, Enum.EasingStyle, Enum.EasingDirection.Out)):Wait()
			end)
		end)
	end
end
  • Вопрос задан
  • 24 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы