generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: farming script help please

Previous Thread :: Next Thread 
Glocks is not online. 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 is not online. 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 is not online. Glocks
Joined: 12 Jun 2009
Total Posts: 647
20 Jul 2013 02:39 PM
Could someone please help?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image