-
I'm using the sandbox function to use Luau but it results in a different outcome to the non-sandboxed Lua. I have a loop where the for _ in 0..10 {
lua.globals().set("state", state)?;
lua.load(
r#"
if state.i == nil then
state.i = 0
end
print("Before incrementing: ", state.i)
state.i = state.i + 1
print("After incrementing: ", state.i)
print("")
"#,
)
.exec()?;
state = PersistedState::from_lua(lua.globals().get("state")?, &lua)?;
} Without
But with, it outputs the following:
Are there any differences between Lua and Luau that would cause this or is it an error in implementation? |
Beta Was this translation helpful? Give feedback.
Answered by
khvzak
Nov 17, 2024
Replies: 1 comment 2 replies
-
Hard to say without full example. Do you have code that I can run to reproduce? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported in luau-lang/luau#1535