Why does this script not work?

Description: Have idea for a script, but you can't make it? Post it here!
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Avatar
Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Reputation: 0
Posts: 28
Joined: 12 Feb 2018
Location: Yoshi's Island

Post #1by Dany The Yoshi Fan » 20 Jul 2018, 22:44

Why does this script not work?

if keypress(-13)=1 then
call TClear(0, Blink)
call TClear(0, Blink2)
call LSet(Blink, 2, 1)
end if

The error I get is:

Error '11' occured compiling the script!
Error in the custom function: Invalid parameters.

Please help!
Image
Image
Image

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 272
Posts: 613
Joined: 9 Nov 2015
Website

Post #2by Lx Xzit » 24 Jul 2018, 21:09

Lset just uses two parameters: layer name and frames wait to be executed. Fix it:

Code: Select all

call LSet(Blink, 0)


Also keypress(*) = 1 doesn't work, valid values are -1 (pressed) or 0 (unpressed). Values are optional so if you want your script only check is the key has been pressed, you can type this:

Code: Select all

if keypress(-13) then


By the way I'd suggest you join the 38A discord since you can get much quicker responses
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Avatar
Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Reputation: 0
Posts: 28
Joined: 12 Feb 2018
Location: Yoshi's Island

Post #3by Dany The Yoshi Fan » 25 Jul 2018, 16:22

But the error is in line 2, not in the Lset function
Image
Image
Image

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 272
Posts: 613
Joined: 9 Nov 2015
Website

Post #4by Lx Xzit » 26 Jul 2018, 0:12

Try to put "Blink2" in quotation marks.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Avatar
Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Reputation: 0
Posts: 28
Joined: 12 Feb 2018
Location: Yoshi's Island

Post #5by Dany The Yoshi Fan » 27 Jul 2018, 4:12

You mean like this?

if keypress(-13)=-1 then
call TClear(0, "Blink")
call TClear(0, "Blink2")
call LSet(Blink, 2, 1)
end if
Image
Image
Image

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 272
Posts: 613
Joined: 9 Nov 2015
Website

Post #6by Lx Xzit » 27 Jul 2018, 16:35

Yes. Okay just found the error, you can't have spaces between parenthesis.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Avatar
Dany The Yoshi Fan
Topic author, Good citizen
Good citizen
Reputation: 0
Posts: 28
Joined: 12 Feb 2018
Location: Yoshi's Island

Post #7by Dany The Yoshi Fan » 29 Jul 2018, 1:15

Thank you, it FINALY works! :clapping: :clapping: :clapping:
Image
Image
Image


Return to “Script requests”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest