slickman130 Posted May 28, 2014 Share Posted May 28, 2014 i am VERY NEW to programming and i hoped i wouldnt have to do much until i learned but my luck ran out and now i have to fix something in the script. when i press play it brings me to the script and a box shows up and says GetPosition (Nil value) First of all what does NilValue mean? second how do i fix that? it says its on line 45 so this is what is on line 45 local targetpos = self.target:GetPosition(true) if anyone can help me fix that i would be greatly appreciative. Thanks in advance! -Nate Quote Link to comment Share on other sites More sharing options...
catch22 Posted May 28, 2014 Share Posted May 28, 2014 nil is null, empty, void, unassigned. So without a script to look at, I'm not really sure. Did you write it, or is it a built in one? Anyway, perhaps self.target is undefined. Quote Coding for Christ. Link to comment Share on other sites More sharing options...
Einlander Posted May 28, 2014 Share Posted May 28, 2014 Nilvalue = no value/nothing Quote Link to comment Share on other sites More sharing options...
Rick Posted May 28, 2014 Share Posted May 28, 2014 I offer a 1 on 1 Lua for Leadwerks training. The link to schedule one is in my sig below. $10 and hour and I go through this kind of stuff. It's meant for beginners or programmers new to Lua and want a quick lesson to catch up fast. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 28, 2014 Share Posted May 28, 2014 About this specific issue I'm sure what's happening is that your self.target variable is empty and not pointing to anything. So it's trying to call the function GetPosition() on a 'nil' object (self.target) which it can't do. Quote Link to comment Share on other sites More sharing options...
slickman130 Posted May 29, 2014 Author Share Posted May 29, 2014 ok thank you guys! and Rick you friended me on Steam and said the same exact thing! Quote Link to comment Share on other sites More sharing options...
Rick Posted May 29, 2014 Share Posted May 29, 2014 You have a different name on here than Steam then . You were the one who replied to my tutorial video asking for help right? Quote Link to comment Share on other sites More sharing options...
slickman130 Posted May 29, 2014 Author Share Posted May 29, 2014 yup thats me xD on steam my name is iamthedoctor10 but my game name is Jewishfalafel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.