Skip to content

Instantly share code, notes, and snippets.

@Achie72
Created April 20, 2024 16:00
Show Gist options
  • Save Achie72/613803ecde501f2e20ff994036f1ad00 to your computer and use it in GitHub Desktop.
Save Achie72/613803ecde501f2e20ff994036f1ad00 to your computer and use it in GitHub Desktop.
Replacer
function replace()
-- collection for the if is it this tile
local tilesToCheck = {1,2,3,4,5,6}
-- collection to replace tile
local tilesToReplace = {10,20,30,40,50,60}
local x,y = 0,0
for i=1,#tilesToCheck do
if mget(x,y) == tilesToCheck[i] then
mset(x,y, tilesToReplace[i])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment