How to set default values for vector parameter

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Gravity_Fall

Member
Feb 26, 2017
4
0
1
33
Code:
function test(v:vector=vector (0,0,0)):
    # cannot be used...

Code:
function test(v:vector=(vector 0,0,0)):
    # cannot be used

Without the vector parameter of the function, I want to default to "vector 0,0,0".
How can this work?
 
try using the first one you have there, but remove the space between vector and the parenthesis, since that's how functions work
 
Code:
function fx_test(v:vector=vector(0,0,0)):
    # Functions cannot be used here (or there is a problem with your arguments). (zex.sk, line 1: function fx_test(v:vector=vector(0,0,0)):')
    send "%{_v}%" to console
function fx_test(v:vector=vector (0,0,0)):
    # 'vector (0,0,0)' is not a vector (zex.sk, line 4: function fx_test(v:vector=vector (0,0,0)):')
    send "%{_v}%" to console
function fx_test(v:vector=vector0,0,0):
    # 'vector0' is not a vector (zex.sk, line 7: function fx_test(v:vector=vector0,0,0):')
    send "%{_v}%" to console
function fx_test(v:vector=vector 0,0,0):
    # 'vector 0' is not a vector (zex.sk, line 10: function fx_test(v:vector=vector 0,0,0):')
    send "%{_v}%" to console
function fx_test(v:vector=(vector0,0,0)):
    # '(vector0,0,0)' is not a vector (zex.sk, line 13: function fx_test(v:vector=(vector0,0,0)):')
    send "%{_v}%" to console
function fx_test(v:vector=(vector 0,0,0)):
    # '(vector 0,0,0)' is not a vector (zex.sk, line 16: function fx_test(v:vector=(vector 0,0,0)):')
    send "%{_v}%" to console

Nothing works.
I have no idea what to do.
 
Status
Not open for further replies.