This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-18 12:38:11

blobmaster
Scratcher
Registered: 2010-12-20
Posts: 11

scripting

how do you make this script "when i recieve "somthing" disable another script" plz  smile

Offline

 

#2 2012-02-18 13:03:27

laptop97
Scratcher
Registered: 2011-06-27
Posts: 1000+

Re: scripting

When gf clicked
Set [variable] = 0

When I recieve [Something]
//Do your scripts here
Set [variable] = 1


The other script (Whatever cap block)
Repeat until <(variable)=1>
  // Do your scripts here
{End of Repeat Until}
Stop script


The timing may be off though because it repeats. It depends on how much is in the repeat. Hope this was helpful  smile

Last edited by laptop97 (2012-02-18 13:04:06)

Offline

 

#3 2012-02-18 14:13:59

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: scripting

laptop97 wrote:

When gf clicked
Set [variable] = 0

When I recieve [Something]
//Do your scripts here
Set [variable] = 1


The other script (Whatever cap block)
Repeat until <(variable)=1>
  // Do your scripts here
{End of Repeat Until}
Stop script


The timing may be off though because it repeats. It depends on how much is in the repeat. Hope this was helpful  smile

An example of the above:

when gf clicked
set [variable v] to (0)
repeat until <(variable) = (1)>
    ask [What do you want to broadcast?] and wait
    broadcast (answer)
end

when I receive [stop v]
set [variable v] to (1)

Last edited by Magnie (2012-02-18 14:14:26)

Offline

 

#4 2012-02-18 21:07:20

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: scripting

Use variables


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#5 2012-03-09 16:33:39

blobmaster
Scratcher
Registered: 2010-12-20
Posts: 11

Re: scripting

how to make this script: stop sprite for 2 seconds

Offline

 

Board footer