Jump to content

ERROR: "Stack overflow"


Cronoss

Recommended Posts

Posted

Well, I'm trying to make an Event from Server-Side to Client-Side so the camera of the player fade in black and backs to normal when the event it's called, but for some reason I got this new error that I never saw before, "stack overflow", I searched and It's a problem that happens when you accidentaly make a infinite loop, but what's wrong with this??

function fadeCamera()
	fadeCamera(source, true, 0.5, 0, 0, 0)
	setTimer(function()
			fadeCamera(source, false)
		end, 1500, 1, source)
	end
addEvent("camaraFade", true)
addEventHandler("camaraFade",getRootElement(), fadeCamera)





 

  • Moderators
Posted
11 minutes ago, Cronoss said:

what's wrong with this??

You named your own function the same as the MTA function.

function fadeCamera()

    fadeCamera(source, true, 0.5, 0, 0, 0)

end

 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   ?

 

  Useful functions  3x 

  Tutorials  4x 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...