Question about creating a "perk" npc

Post Reply
grim420
Posts: 3
Joined: Wed Sep 11, 2019 9:33 pm

Question about creating a "perk" npc

Post by grim420 » Wed Sep 11, 2019 9:36 pm

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!

User avatar
whasf
Site Admin
Posts: 1300
Joined: Thu Jul 19, 2012 9:11 pm

Re: Question about creating a "perk" npc

Post by whasf » 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.
-- Whasf

grim420
Posts: 3
Joined: Wed Sep 11, 2019 9:33 pm

Re: Question about creating a "perk" npc

Post by grim420 » Thu Sep 12, 2019 11:15 am

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!

User avatar
whasf
Site Admin
Posts: 1300
Joined: Thu Jul 19, 2012 9:11 pm

Re: Question about creating a "perk" npc

Post by whasf » Thu Sep 12, 2019 11:30 am

In scripts/globals/spells look at protect.lua
-- Whasf

grim420
Posts: 3
Joined: Wed Sep 11, 2019 9:33 pm

Re: Question about creating a "perk" npc

Post by grim420 » Thu Sep 12, 2019 12:39 pm

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.

Post Reply