Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onMouseClickFieldSection1()
- print("Clicked on Field Section 1")
- local part = clickDetectorFieldSection1.Parent
- if(cropFullyGrown.FieldSection1 == true) then
- inventory.Cotton = inventory.Cotton + 1
- updateInventoryGUI()
- part["Cotton5"]:Destroy()
- part.Transparency = 0.5
- cropFullyGrown.FieldSection1 = false
- else
- if(inventory.Gold >= 10)
- then
- clickDetectorFieldSection1.MaxActivationDistance = 0
- inventory.Gold = inventory.Gold - 10
- updateInventoryGUI()
- part.Transparency = 1
- if(cropFullyGrown.FieldSection1 == false) then
- for index = 1, #cottonArray do --#cottonArray = size of cottonArray
- local partToClone = cottonArray[index]
- local clone = partToClone:Clone()
- clone.Parent = part
- local startCFrame = CFrame.new(part.Position)
- clone:setPrimaryPartCFrame(startCFrame)
- wait(2)
- if(index ~=6) then
- clone:Destroy()
- else
- cropFullyGrown.FieldSection1 = true
- end
- end
- end
- clickDetectorFieldSection1.MaxActivationDistance = 32
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement