Jump to content
The Indie Stone Forums
Sign in to follow this  
IanSchot

Lua recipe trait checking?

Recommended Posts

So i've been trying to figure out how i can get a OnCreate:(This case "recipe_DoStuff") to successfuly check and fire a output if a trait is met.

I'm not too sure what i'm doing wrong here.

 

function recipe_DoStuff(items, result, player)
    --other stuff
        if player:hasTrait("WeakStomach") == true then
        player:Say("I Pooped my pants.");  --this would be my generic output.
        end
    --other stuff
end 

 

This file is in media/lua/server, if that makes a difference.

Share this post


Link to post
Share on other sites

You will want to move this file to media/lua/client rather than media/lua/server/. You'll also want to verify your recipe in your txt file has the OnCreate: line calling this function.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...