Re: Scripts Workshop: Give and get help with scripts

BirdByte wrote:

I think you should link to the post where the problem was resolved in the OP.

I tried but it didn't work.

Jodymoses wrote:

JH1010 shouldnt it be

when gf clicked
forever
change y by <yv>
if <touching colour [#000000]?>
set [yv v] to (1) // This should be zero.
if <key [up arrow v] pressed?>
set [yv v] to (6) // I opted for the change y veocity by 6 block here but that works too.
end
change [yv v] by (-0.25) // This should not be in this loop because it would lower you through the ground. Also, I forgot the minus in my example.
end
end

to the post above?Please fix...

Fixed and explained. Also, if you highlight the yellow stuff it will appear in google toolbar so you can read the end of it.

When I run the script, the sprite will always hide at the appropriate time, but it will often not play the cricket sound. Most of the time it does, but sometimes it doesn't. Is it because there are too many other scripts that are all being executed at the same time? Or is it because the hide block interferes with the cricket sound block? Any help would be appreciated.

Re: Scripts Workshop: Give and get help with scripts

Jodymoses wrote:

I would exchange hide with set ghost to 100 and show with set ghost to 0.

when gf clicked
forever
if <touching [sprite1 v]?>
set [ghost] effect to [100]//hide
else
set [ghost] effect to [0]//show
end
end

fix please

Fixed,

strawpile wrote:

Having a problem with playing a sound when one sprite touches another. The code for the whole program is quite lengthy, but the part plays the sound is rather simple:

when [space v] key pressed
show
go to x: (25) y: (25)
forever
move (5) steps
if on edge, bounce
if <touching [sprite1 v]?>
play sound [cricket v] until done
end
if <touching [sprite7 v]?>
go to [sprite6 v]
end
if <touching [sprite6 v]?>
go to [sprite7 v]
end
end

When I run the script, the sprite will always hide at the appropriate time, but it will often not play the cricket sound. Most of the time it does, but sometimes it doesn't. Is it because there are too many other scripts that are all being executed at the same time? Or is it because the hide block interferes with the cricket sound block? Any help would be appreciated.

I fixed your scratchblocks code

Now, you could do what Jodymoses said, but here's another solution:

when [space v] key pressed
show
go to x: (25) y: (25)
forever
move (5) steps
if on edge, bounce
if <touching [sprite1 v]?>
broadcast [hide v]
play sound [cricket v] until done
end
if <touching [sprite7 v]?>
go to [sprite6 v]
end
if <touching [sprite6 v]?>
go to [sprite7 v]
end
end