Properties are nill in new functions in lua script how to fix this?

0

Ok this is my problem I created a new function and I try and use the variables in the properties in it but to the function they basically don't exist. I'm not sure how this is done but how do I make sure newly created functions can access the Properties that I create.

This is my Code:

REMOVEDUPLOAD

These R my Properties

REMOVEDUPLOAD

This is where I Cause the function to to reload the ammo

REMOVEDUPLOAD

This is where I update the properites but in the console says they are all nill.

Is there a method to pass variables to functions, am I missing something. Any Help would make me happy. :D

질문됨 6년 전197회 조회
4개 답변
0
수락된 답변

@REDACTEDUSER

There are two questions/problems here:

  1. the nil issue
  2. passing variables to a function

On #1: I believe your problem is in your debug.log call to the self. It should be self.Properties.myAmno

#2: Yes, you can pass values to your functions, but it's not required for this example. Just put the value you wish to pass in the () of the function call. Then in the function declaration, put the parameter name that you want to use in the function in the ().

Hope that puts you on the right track!

답변함 6년 전
profile picture
전문가
검토됨 8시간 전
0

U r correct @REDACTEDUSER

답변함 6년 전
0

Errors are very unforgiving and cant tell there there till they hit u in the face. : ) well done

답변함 6년 전
0

And in game engines doubly so!-)

답변함 6년 전

이 게시물은 마감됨: 새 답변, 댓글 및 투표 추가가 비활성화되었습니다.

관련 콘텐츠