|
| 12 Aug 2011 01:15 AM |
This is the first script in the button, values are stocked up but this isn't working.
function onClicked()
if game.Workspace.CheesePValue.howmuch.Value > 0 and game.Workspace.BoxesValue.howmuch.Value > 0 then
script.Parent.BrickColor = BrickColor.new(21) game.Workspace.CheesePValue.howmuch.Value = game.Workspace.CheesePValue.howmuch.Value-1 game.Workspace.BoxValue.howmuch.Value = game.Workspace.BoxValue.howmuch.Value-1 game.Workspace.ohnocheesep.Decal.Transparency = "1"
local p = Instance.new("Part") p.Name = "CheesePizzaBox" p.Size = Vector3.new(5, 1.2, 5) p.Position = Vector3.new(152, 4.6, -205) p.Parent = game.Workspace p.BrickColor = BrickColor.new(1001)
local d = Instance.new("Decal") d.Texture = "http://www.roblox.com/asset/?id=59073213" d.Face = "Top" d.Parent = p
local m = Instance.new("BlockMesh") m.Parent = p
wait(1) script.Parent.BrickColor = BrickColor.new(37)
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
2nd:
function onClicked()
if game.Workspace.CheesePValue.howmuch.Value == 0 and game.Workspace.BoxValue.howmuch.Value == 0 then
script.Parent.BrickColor = BrickColor.new(21) script.Parent.Parent.Parent.Name = "Cheese Pizzas and Boxes needed!" game.Workspace.ohnocheesep.Decal.Transparency = "0" game.Workspace.ohnoboxes.Decal.Transparency = "0" wait(2) script.Parent.BrickColor = BrickColor.new(37) script.Parent.Parent.Parent.Name = "Box Cheese Pizza" game.Workspace.ohnocheesep.Decal.Transparency = "0" game.Workspace.ohnoboxes.Decal.Transparency = "0"
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
3rd
function onClicked()
if game.Workspace.CheesePValue.howmuch.Value == 0 then
script.Parent.BrickColor = BrickColor.new(21) script.Parent.Parent.Parent.Name = "Cheese Pizzas needed!" game.Workspace.ohnocheesep.Decal.Transparency = "0" wait(2) script.Parent.BrickColor = BrickColor.new(37) script.Parent.Parent.Parent.Name = "Box Cheese Pizza" game.Workspace.ohnocheesep.Decal.Transparency = "0"
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
4th
function onClicked()
if game.Workspace.BoxValue.howmuch.Value == 0 then
script.Parent.BrickColor = BrickColor.new(21) script.Parent.Parent.Parent.Name = "Boxes needed!" game.Workspace.ohnoboxes.Decal.Transparency = "0" wait(2) script.Parent.BrickColor = BrickColor.new(37) script.Parent.Parent.Parent.Name = "Box Cheese Pizza" game.Workspace.ohnoboxes.Decal.Transparency = "0"
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I need some help with all this. The values are all above 0 and I am worried about the 'if' bit with 'and' in it. HELP! |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 01:16 AM |
*Typo in title
!FLOODCHECK! |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Aug 2011 01:26 AM |
| 16 views and no posts? IS THIS ALL TOO HARD FOR YOU? O_o |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 01:28 AM |
| When we see the script, we say, "Oh, this is too long to fix. I'll go fix the shorter ones first." |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Aug 2011 01:30 AM |
| My point was, only post the lines that are troubling you, that the output gives errors on, not the whole script. Try putting in some prints as a milestone checker. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 12 Aug 2011 02:19 AM |
What's the output? Also, I don't think decal transparency works....does it? |
|
|
| Report Abuse |
|
|