Discord
Login
Community
DARK THEME

So i created a class, and everything works fine, and it does everything well, but it still tells me that my functions are no functions

normally i would just start looking for a mistake, but the programm runs fine, it does actually do the functions but still tells me they are not defined, eventhough the programm does them?

Warning: Player.info() is not a function, in file "kampffunktionen" at line 16, column 20

this is the message i get, and it only happens with all my functions i defined in classes, as i said its really confusing because the programm actually does do the functions, it just says its not defined.

has anybody had a similar problem or knows of a way to fix this? i mean i could juist go on bc all works fine but the warning messages do start to be a huge pain in the a

In my opinion, it's a MicroScript error which is that it executes the code from the "update" function before all the code from "init" is executed.

If the code that creates the error is called with "update" and Player is created in init - that was the scenario for this error.

Try this code - you shouldn't have the error anymore.

tempUpdate = function()
end

init = function()
  local oldUpdate = update
  update = tempUpdate
  // you init code 
  //....
  //
  while system.loading<100 
    print( system.loading ) 
  end  
  update = oldUpdate
end

When MicroScript encounters a name that doesn't exist error, it treats it as a new variable and sets the name to "0" .

It will show you if this function exists when called.

  if Player.type == 0 then 
    print( "Error")
  else
    print( Player.Info() )
  end

aright thanks, gonna try this out right away!

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community