of     1   

smunkey
#142806062Wednesday, August 06, 2014 7:55 PM GMT

I have made this script that goes in a frame. The number starts as zero but increases by one every time you click a block. (In a separate working script there is '_G.lpc = 50' and '_G.grain = 0'. However, the textlabel will only output the original _G.grain value and then only change when you change it manually. while _G.grain>0 do script.Parent.Parent.TextLabel.Text = _G.grain wait(1) end in the blocks are this script. There are 108 of these blocks. function onClicked() _G.grain = _G.grain + 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked) Neither of the scripts output errors in the script or output. What is wrong and how do I fix it?
smunkey
#142816749Wednesday, August 06, 2014 9:49 PM GMT

bump
Zawie
#142817653Wednesday, August 06, 2014 9:59 PM GMT

Erm check if the block/script is in the right place. Acording to this this block is in GUi...
smunkey
#142819289Wednesday, August 06, 2014 10:17 PM GMT

The block scripts are inside the correct spot (inside the part you click on) and are not in the gui, they just sorta sit around on the map.
Zawie
#142831681Thursday, August 07, 2014 12:27 AM GMT

Where is the script?
smunkey
#142869504Thursday, August 07, 2014 9:05 AM GMT

The first script is in a textlabel, in a frame, in the startergui the second script is in a part, in a model, in the workspace
smunkey
#142908062Thursday, August 07, 2014 8:07 PM GMT

I'm guessing I spelt/wrote this line of script wrong, but I have no idea how to fix it. script.Parent.ClickDetector.MouseClick:connect(onClicked)
Clirex
#142910320Thursday, August 07, 2014 8:30 PM GMT

.Clicked()
cntkillme
#142910510Thursday, August 07, 2014 8:32 PM GMT

while true do script.Parent.Parent.TextLabel.Text = _G.grain wait(1) end
smunkey
#142941175Friday, August 08, 2014 1:44 AM GMT

I don't know if this helps, but next to the click for more grain script is this script that makes the block it is in invisible for 300 seconds. function onClicked() script.Parent.CanCollide = false script.Parent.Transparency = 1 debounce = false wait(300) debounce = true script.Parent.CanCollide = true script.Parent.Transparency = 0 end script.Parent.ClickDetector.MouseClick:connect(onClicked) This one is in a normal script, and it works perfectly fine. But I am guessing there might be something in this script interfering with the loclascript
smunkey
#142943780Friday, August 08, 2014 2:10 AM GMT

These are some of the very early versions of the script if you want to mess with those. The GUI: http://www.roblox.com/broken-backpack-item?id=170198810 The block: http://www.roblox.com/space-wheat-item?id=169455421 (delete 8 of the yellow rods called 'grain' to make testing easier)
Clirex
#142990362Friday, August 08, 2014 4:16 PM GMT

Play around with printing in the output to see when the script stops
smunkey
#143146492Sunday, August 10, 2014 2:28 AM GMT

I finished fixed it, thanks for all the help.
smunkey
#143230459Monday, August 11, 2014 12:04 AM GMT

Nevermind, this script will work while testing it in studio, but not in an actaul game. function clicked() local g = _G.grain g = g + 1 _G.grain = g end script.Parent.ClickDetector.MouseClick:connect(clicked)
smunkey
#143307008Monday, August 11, 2014 8:04 PM GMT

The above script is in a normal script, I tried moving it to a localscript but it wouldn't even work in studio when I did that.
Lacryma
#143307274Monday, August 11, 2014 8:07 PM GMT

repeat wait() until (_G.grain ~= nil) function clicked() _G.grain = _G.grain + 1 end script.Parent.ClickDetector.MouseClick:connect(clicked)
smunkey
#143417615Tuesday, August 12, 2014 10:35 PM GMT

That doesn't work, thanks for trying anyways. Anyways, it may have something to do with having two different kinds of scripts in a single brick, or it might be something to do with localscripts and clickdetectors.
smunkey
#143501309Wednesday, August 13, 2014 8:48 PM GMT

This script has me stumped, I give up on it for now. If you give me a script that doesn't work I will still mess around with it a bit.

    of     1