Page 1 of 1

Question about creating a "perk" npc

Posted: Wed Sep 11, 2019 9:36 pm
by grim420
Hello and thank you for reading my post!

I've scoured the forums for hours, reading and trying to create my own perk npc. I decided to edit an existing npc (in South Sandy) and I'm trying to have the npc give buffs after talking with her. I keep getting an error saying that "attempt to call method 'addeffect' (a nil value)" and I'm unsure of what I am doing wrong. I've edited the .lua so that the npc is supposed to player:addeffect but to no avail.

Thank you again for any advice!

Re: Question about creating a "perk" npc

Posted: Thu Sep 12, 2019 10:36 am
by whasf
Look at how something like Protect adds the effect? Also, make sure you use proper case for the function names.

Re: Question about creating a "perk" npc

Posted: Thu Sep 12, 2019 11:15 am
by grim420
whasf wrote:
Thu Sep 12, 2019 10:36 am
Look at how something like Protect adds the effect? Also, make sure you use proper case for the function names.
Thank you for replying! I'm sorry, I'm still new to this whole thing ( and to coding as well, only started learning Java and Python early this year . I'm confused what you mean by "Look at how something like Protect adds the effect?". Are you saying I should look at how that specific spell functions on a target player? How would I find the specific spells in my folders to look at such a thing? Sorry if I'm overthinking this or asking dumb questions. Thank you again for your time!

Re: Question about creating a "perk" npc

Posted: Thu Sep 12, 2019 11:30 am
by whasf
In scripts/globals/spells look at protect.lua

Re: Question about creating a "perk" npc

Posted: Thu Sep 12, 2019 12:39 pm
by grim420
Thank you so much, that was a big help. All I've managed to do is crash my server repeatedly, lol, but I feel like I've taken a big step in the right direction.