User Tag List

Results 1 to 4 of 4

Thread: Lua object, whats wrong with what im doing?

  1. #1
    No Products Registered

    Join Date
    Sep 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua object, whats wrong with what im doing?

    basically im trying to make a program that when given a percent does a calculation to see if that time it will return positive or negative.

    the lua script is as follows:
    function hit(z)
    Z=tonumber(z)
    if z<=random(100) then
    return "1";
    else
    return "0";
    end
    end

    I then just call the function "hit" with the percentage in the parameter with returns as 1.
    i then set an edit box to return(0)
    When i run it it gives the error: "Attempt to get string return but no values to return".

    Thankyou for you help in advance

  2. #2
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua object, whats wrong with what im doing?

    create an event to get the error and see what it says

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua object, whats wrong with what im doing?

    Try this:

    []
    function hit(z)
    z=tonumber(z)
    if z<=math.random(100) then
    return "1"
    else
    return "0"
    end
    end
    [/]

  4. #4
    No Products Registered

    Join Date
    Sep 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua object, whats wrong with what im doing?

    Thankyou that works fine

Similar Threads

  1. Is there something wrong with the Active Background Object?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th February 2012, 03:28 PM
  2. The Wrong Object...
    By VAH in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th January 2011, 01:21 AM
  3. GET object bug, MMF bug or me doing it wrong?
    By Gibbon in forum File Archive
    Replies: 7
    Last Post: 9th November 2010, 03:33 PM
  4. can somebody see whats wrong here
    By bubba_damage in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th April 2010, 12:38 AM
  5. whats wrong with this CT page?
    By jpcr in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th February 2009, 01:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •