This was literally the simplest thing. Everyone else was listing the most complicated ways lol. Thanks everyone for responding!Robin wrote:Note that ivan's copy functions crash if you pass a table with cycles.
Now, what you probably want is none of this, but just a reset function:
Then you can simply call player.Reset().Code: Select all
player = {} function player.Reset() player.x = 10 player.y = 636 player.width = 80 player.height = 80 player.speed = 300 player.xVel = 0 player.yVel = 0 player.jumpVel = -800 player.score = 0 player.lives = 3 player.state = "stand" end player.Reset()
[solved] Resetting a table back to it's original values
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Resetting a table back to it's original values
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests