Glocks
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 647 |
|
|
| 20 Jul 2013 12:44 PM |
this script is in a plate brick called soil and a clickdetector is also in with the script the Sv and Wv are for my guis to minus and add the amount of seeds and wheat so this script works its just when i gather the wheat when its done growing and plant another one on the the same brick it doesn't let me gather the wheat when its done.
bin = script.Parent Sv = game.Players.LocalPlayer.PlayerGui.InvHolder.Inv.SeedsN.Seeds Wv = game.Players.LocalPlayer.PlayerGui.InvHolder.Inv.WheatN.Wheat
function onclick() s = bin:FindFirstChild("seed") if s == nil and Sv.Value > 0 then Sv.Value = Sv.Value - 1 p = Instance.new('Part') p.Name = 'seed' p.Parent = bin p.Size = Vector3.new(0,1,0) p.CFrame = CFrame.new(bin.Position.x,bin.Position.y + .8,bin.Position.z) p.Anchored = true p.BrickColor = BrickColor.new('Pastel green') wait(5) growth() else return end end
bin.ClickDetector.MouseClick:connect(onclick)
grown = false function growth() grow = bin.seed grow.Size = Vector3.new(0,2,0) grow.CFrame = CFrame.new(bin.Position.x,bin.Position.y + 1,bin.Position.z) grow.BrickColor = BrickColor.new('Medium green') wait(5) grow.Size = Vector3.new(0,4,0) p.CFrame = CFrame.new(bin.Position.x,bin.Position.y + 1,bin.Position.z) grow.BrickColor = BrickColor.new('Olive') wait(5) grow.Size = Vector3.new(0,5,0) p.CFrame = CFrame.new(bin.Position.x,bin.Position.y + 1,bin.Position.z) grow.BrickColor = BrickColor.new('Cool yellow') wait(1) grown = true end
function ontouch() if grown == true then bin.seed:Destroy() Wv.Value = Wv.Value + 1 end end
bin.Touched:connect(ontouch) |
|
|
| Report Abuse |
|
Glocks
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 647 |
|
|
| 20 Jul 2013 01:31 PM |
| Maybe I have to add a bool somewhere? |
|
|
| Report Abuse |
|
Glocks
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 647 |
|
|
| 20 Jul 2013 02:39 PM |
| Could someone please help? |
|
|
| Report Abuse |
|