Scripting and switches bug

tried to place button but it just teleported to a random place on the map. then scripted a wall to move upon interaction with the button. it didn’t work. anyone else having this problem?