I don't understand the question, could you elaborate? If you want to get output from a custom block, you need to make the round "reporter" type, and then put it into your script.
In the picture, your SET SPEED TO block doesn't do anything! For example, if you made a global variable called SPEED you could then do this:
There are other things you could do besides put it in a variable, but you have to put it somewhere in your SET SPEED block, because the input variable, the one you called SPEED and I called NEW SPEED (to make it different from the global variable name), is temporary; it's only available while that block is running.
yes but why cant u do ask [set speed to (speed)] for speed
"Set speed to (...)" is a command block, not a reporter block. It doesn't report a value, so it can't be used as input to another block.
Also, the ASK block requires a sprite as its first input, not a number.
That's not what the "ask" block is used for.
but y cand u do this
Dizzy code
???whAt u mean
but you could at least get the speed from the block
These blocks:
[scratchblocks]
tell [ v] to ({...} :: grey ring) :: control
(ask [ v] for ((... :: grey) :: grey ring) :: control
[/scratchblocks]
are for running blocks and scripts in another sprite.
Make a variable for speed. If you really don't want to make a Snap! variable for speed, do this:
JS f
[scratchblocks]
{set speed to ((new speed # = 1) :: motion) :: motion} :: control hat
run (JavaScript function \( [newSpeed] \) \{ [this.speed = newSpeed;] \} :: operators) with inputs (new speed) :: control
(speed :: motion) :: control hat
report (call (JavaScript function \( \) \{ [return +this.speed;] \} :: operators) :: control) :: control cap
[/scratchblocks]
thanks it works now i can make blocks